graphical swap comparison of aa and rik vm
In an earlier post i mentioned a way of locking up my vm easily and repeatedly but that has since been fixed in one way or another. I reran the test and took vmstat 1 's of both runnings on a 2.4.14-pre6-preempt kernel and a 2.4.13-ac5-preempt kernel. I began both vmstat's at the same time (about 4 seconds before running each). What i did was run kghostview on a postscript file located here http://safemode.homeip.net/test.ps . It is 224K. kmail was loaded previously in both trials so kdeinit was already
loaded as were all libs. After kghostview became responsive, i waited a few
seconds (again about 5) and then exited the app.
No other interaction or running programs were present while doing this. I have 771580 KB of ram and 290740 KB of swap.
Now to explain the graphs.
The blue is AA's vm. The red is Rik's vm. Rik's vm finished in 66 seconds. AA's vm finished in 52 seconds. Both start at 0 swap usage. Both from clean boots.
Here is the graph http://safemode.homeip.net/vm_swapcomparison.png . It's
about 4.6K.
When you look at the graph it goes like this.
The left side is 0 seconds, the right side is 66 seconds. bottom is 0KB, top is 290740KB.
These are generated from data from the orignal vmstat outputs. These are at
http://safemode.homeip.net/aa_vmstat
and
http://safemode.homeip.net/rik_vmstat
I'll leave the actual interpretation of the data of both the graph and raw data up to those who actually know the code.
Neadless to say that while running the test on either box, the entire computer became unresponsive multiple times for extended lengths of times. No OOM was generated on either run.
Quoted 2 lines · safemode
Here is the graph http://safemode.homeip.net/vm_swapcomparison.png . It's
about 4.6K.
The server says, "Wrong file name fool."
Quoted 5 lines · Alex Pennace
Quoted 2 lines · safemode
Here is the graph http://safemode.homeip.net/vm_swapcomparison.png .
It's about 4.6K.The server says, "Wrong file name fool."
Fixed it. That's what you get when you're creating the graph at the same
time as writing the email. Sorry to all. it will work now.
I decided it would be nice to see the actual swap io as well. since
allocating and writing and reading are two different things.
http://safemode.homeip.net/si-swap.png (max 24508)
http://safemode.homeip.net/so-swap.png (max 118132)
http://safemode.homeip.net/bi-swap.png (max 24536)
finally, i redid the swap one i have posted before. This time it has correct scaling. Because of this you'll see a final dropoff of the aa's graph to 0, disregard it, as well as all of the 0 data in the other graphs as they're there to keep scale correct. Everything after 52 seconds in the aa graphs is filler.
http://safemode.homeip.net/swap.png (max 290740)
All of these are larger than before due to the larger dimensions of the graph files. feel free to mirror them if i end up not being fast enough.
Quoted 36 lines · safemode
In an earlier post i mentioned a way of locking up my vm easily and repeatedly but that has since been fixed in one way or another. I reran the test and took vmstat 1 's of both runnings on a 2.4.14-pre6-preempt kernel and a 2.4.13-ac5-preempt kernel. I began both vmstat's at the same time (about 4 seconds before running each). What i did was run kghostview on a postscript file located here http://safemode.homeip.net/test.ps . It is 224K. kmail was loaded previously in both trials so kdeinit was already
loaded as were all libs. After kghostview became responsive, i waited a
few seconds (again about 5) and then exited the app.No other interaction or running programs were present while doing this. I have 771580 KB of ram and 290740 KB of swap.
Now to explain the graphs.
The blue is AA's vm. The red is Rik's vm. Rik's vm finished in 66 seconds. AA's vm finished in 52 seconds. Both start at 0 swap usage. Both from clean boots.Here is the graph http://safemode.homeip.net/vm_swapcomparison.png .
It's about 4.6K.When you look at the graph it goes like this.
The left side is 0 seconds, the right side is 66 seconds. bottom is 0KB, top is 290740KB.These are generated from data from the orignal vmstat outputs. These are at http://safemode.homeip.net/aa_vmstat
and
http://safemode.homeip.net/rik_vmstatI'll leave the actual interpretation of the data of both the graph and raw data up to those who actually know the code.
Neadless to say that while running the test on either box, the entire computer became unresponsive multiple times for extended lengths of times. No OOM was generated on either run.
Quoted 1 line
Here is the graph http://safemode.homeip.net/vm_swapcomparison.png . It's
here's my munge of the same data:
http://mhahn.mcmaster.ca/~hahn/foo.png
the measures I find interesting are the SI/SO rates. first, the most obvious feature is that Rik-VM has a serious problem knowing when to *stop* swapping out. but SO isn't a bad thing unless it's obsessive: it's when you see high *swap-in* that you know the VM has previously chosen bad pages to SO. and this is the second big difference: Rik-VM doesn't make nearly as many mistakes - especially look at Andrea-VM thrashing out-in-out at ~ samples 26-32.
also, if you merely sum the SI and SO columns for each:
sum(SI) sum(SO) sum(SI+SO)
Rik-VM 43564 317448 290032
AA-VM 118284 171748 361012to me, this looks like the same point: Rik being SO-happy, Andrea having to SI a lot more. interesting also that Andrea wins the race, in spite of poorer SO choices and more swap traffic overall.
Quoted 2 lines
Neadless to say that while running the test on either box, the entire computer became unresponsive multiple times for extended lengths of times.
yes, unfortunately this corrupts the value of the data, since the timecourses are not really comparable, and samples are only vaguely related to time...
regards, mark hahn.
Quoted 21 lines · Mark Hahn
Quoted 2 lines
Here is the graph http://safemode.homeip.net/vm_swapcomparison.png .
It'shere's my munge of the same data:
http://mhahn.mcmaster.ca/~hahn/foo.png
the measures I find interesting are the SI/SO rates. first, the most obvious feature is that Rik-VM has a serious problem knowing when to *stop* swapping out. but SO isn't a bad thing unless it's obsessive: it's when you see high *swap-in* that you know the VM has previously chosen bad pages to SO. and this is the second big difference: Rik-VM doesn't make nearly as many mistakes - especially look at Andrea-VM thrashing out-in-out at ~ samples 26-32.also, if you merely sum the SI and SO columns for each:
sum(SI) sum(SO) sum(SI+SO) Rik-VM 43564 317448 290032 AA-VM 118284 171748 361012to me, this looks like the same point: Rik being SO-happy, Andrea having to SI a lot more. interesting also that Andrea wins the race, in spite of poorer SO choices and more swap traffic overall.
Quoted 7 lines
Quoted 3 lines
Neadless to say that while running the test on either box, the entire computer became unresponsive multiple times for extended lengths of times.
yes, unfortunately this corrupts the value of the data, since the timecourses are not really comparable, and samples are only vaguely related to time...
If you miss anything you miss the plateu data that would be found when the IO peaks. But i doubt much at all was really lost in this case.
Quoted 1 line
regards, mark hahn.
Actually i found that most if not all of the vmstat's that weren't being displayed were displayed immediately after the "locks", ie. I got flooded with vmstats upon the computer becoming responsive again.
Of course I should have been timing each run with a stopwatch, but that never
crossed my mind that the vmstat would be lost. In other words i thought of
it as analogous to having burst-lag on irc. Guess that's for tomorrow after work.
Quoted 13 lines · Mark Hahn
Quoted 2 lines
Here is the graph http://safemode.homeip.net/vm_swapcomparison.png .
It'shere's my munge of the same data:
http://mhahn.mcmaster.ca/~hahn/foo.png
the measures I find interesting are the SI/SO rates. first, the most obvious feature is that Rik-VM has a serious problem knowing when to *stop* swapping out. but SO isn't a bad thing unless it's obsessive: it's when you see high *swap-in* that you know the VM has previously chosen bad pages to SO. and this is the second big difference: Rik-VM doesn't make nearly as many mistakes - especially look at Andrea-VM thrashing out-in-out at ~ samples 26-32.
Quoted 7 lines
also, if you merely sum the SI and SO columns for each:
sum(SI) sum(SO) sum(SI+SO) Rik-VM 43564 317448 290032 AA-VM 118284 171748 361012to me, this looks like the same point: Rik being SO-happy, Andrea having to SI a lot more. interesting also that Andrea wins the race, in spite of poorer SO choices and more swap traffic overall.
My guess is that rik's vm allocates memory too relaxed. It quickly grabbed all the memory it thought it would need so it wouldn't have to waste time increasing or shrinking it (i guess that's why) and in doing so it started to strangle memory needed for other things, generally decreasing the overall performance of the system. That could be why you see spikes increasing and decreasing rapidly in rik's vm allocation of swap. He had allocated everything and needed to shrink it to make room for something else (actual generation of the kde window for kghostview?) which caused it to lose much time and any advantage it had gained by not making actual swap mistakes. AA's memory allocation is more minimalistic but it easily has room for the memory needed to render the kde window and all once processing the ps file was done. This would also back up what i visually saw during the test. Rik's kernel got done the processing of the ps file before AA's did, but it was stuck at a frozen looking kghostview window with nothing inside it for a
while before being able to actually render the contents. AA's was able to
render the contents almost immediately after the window showed up on the screen.
Quoted 9 lines · Mark Hahn
Quoted 2 lines
Here is the graph http://safemode.homeip.net/vm_swapcomparison.png . It's
here's my munge of the same data:
http://mhahn.mcmaster.ca/~hahn/foo.png
the measures I find interesting are the SI/SO rates. first, the most obvious feature is that Rik-VM has a serious problem knowing when to *stop* swapping out. but SO isn't a bad thing unless it's obsessive: it's when you see high *swap-in* that you know the VM has previously chosen bad pages to SO.
Sure. SO isn't bad for the benchmark, but think of the guy trying to use the machine after the test finished. It probably swapped out a lot of other processes which is why you didn't see it swap in again. These things weren't needed for the bench, but daily use don't look like that. If my big job takes a long time - no problem if I can work on something else with nice performance.
Quoted 10 lines
and this is the second big difference: Rik-VM doesn't make nearly as many mistakes - especially look at Andrea-VM thrashing out-in-out at ~ samples 26-32.
also, if you merely sum the SI and SO columns for each:
sum(SI) sum(SO) sum(SI+SO) Rik-VM 43564 317448 290032 AA-VM 118284 171748 361012to me, this looks like the same point: Rik being SO-happy, Andrea having to SI a lot more. interesting also that Andrea wins the race, in spite of poorer SO choices and more swap traffic overall.
It'd be real interesting to know wether or not the "excessive" swapping caused extra seeks. Readahead or simply reading more consecutive blocks don't hurt - while seeks do. Perhaps this is why it didn't hurt so much?
Also consider the multiuser aspect - punishing a memory pig with extra swapin isn't necessarily so bad, if it keeps more memory around for others. Could possibly be bad for a dedicated box, but Andrea won on speed anyway.
Helge Hafting
Quoted 7 lines · Mark Hahn
also, if you merely sum the SI and SO columns for each:
sum(SI) sum(SO) sum(SI+SO) Rik-VM 43564 317448 290032 AA-VM 118284 171748 361012to me, this looks like the same point: Rik being SO-happy, Andrea having to SI a lot more. interesting also that Andrea wins the race, in spite of poorer SO choices and more swap traffic overall.
I think this is because in safemode's test, the swap space gets exhausted. My VM works better when there is lots of swap space available but degrades in the (rare) case where swap space is exhausted.
Testing corner cases always gives interesting results ;)
regards,
Rik
Signature · 3 lines
DMCA, SSSCA, W3C? Who cares? http://thefreeworld.net/ http://www.surriel.com/ http://distro.conectiva.com/
Quoted 14 lines · Rik van Riel
Quoted 7 lines · Mark Hahn
also, if you merely sum the SI and SO columns for each:
sum(SI) sum(SO) sum(SI+SO) Rik-VM 43564 317448 290032 AA-VM 118284 171748 361012to me, this looks like the same point: Rik being SO-happy, Andrea having to SI a lot more. interesting also that Andrea wins the race, in spite of poorer SO choices and more swap traffic overall.
I think this is because in safemode's test, the swap space gets exhausted. My VM works better when there is lots of swap space available but degrades in the (rare) case where swap space is exhausted.
Quoted 5 lines
Testing corner cases always gives interesting results ;)
regards,
Rik
In my previous post i mentioned something like that as to why your vm didn't perform as well. The thing isn't that you use all of my available memory (ram + swap), it's that you allocate it all, leaving nothing for the program later on. I think anything that uses almost a gig of ram outside of databases is going to be a corner case, but perhaps a better way to figure
out how much memory should be allocated is needed here. Andrea's vm seems
to do a good job at that. if only he could figure out a better way to swap out pages correctly the first time (as some people say his made more mistakes than yours) then i cant really find anything bad about it. And i'm trying to.
Also as others pointed out. After the process was done. You had quite a lot
more swap still allocated. Why exacty?
I think the answer of why AA's kernel beat rik's has nothing to do with how much swap rik is using or how much swap is being swapped back in. It has to do with how rik decides what to swap. Apparently the algorithm used by rik to play with memory is taking seriously too much cpu and it leaves little for the actual process to work. Thus AA's less cpu intensive code allows the program to actually run and despite making errors in what to swap-out, the process finishes well before Rik's more intelligent code.
Unfortunately, the trailing columns in my aa vmstat somehow got lost during the paste from terminal buffer to file. This means i'm going to have to redo it all in order to get an accurate measurement to compare system cpu time to the rik vm. But for now i think the rik vm system graph is sufficient. And there are some numbers from the AA vmstat and those alone show a much lower cpu usage than in rik's. MUCH.
I made an overlay of Rik's system ( kernel ) cpu usage on top of the so and si graphs to illustrate this. Bottom being 0% top being 100% usage.
http://safemode.homeip.net/sys_so.png
Here we see that after every major write out, there is major kernel cpu usage. This is serious usage, and this is the reason why rik's VM loses the race even though it swapped out and in the right things the first try more often than AA's.
http://safemode.homeip.net/sys_si.png
Of course after each major write out in Rik's vm there is a minor read in. These happen to be directly under the cpu spikes so this could be the cause of the cpu usage, perhaps determining where the page is? I dont know enough about what's going on in the code to figure out if the VM does something after writing out that could be using all that cpu or if whenever it needs to read in. Although now that i look at it i'm tending to lean towards some bad code dealing with swap -> ram.
This is truly where the simple vm design conquers the complex. Less cpu being used by the kernel means more by the program, and sometimes the time gained by not using a lot of cpu greatly outweighs the time lost by having to correct mistakes with deciding what gets swapped in and out.
Maybe i'm wrong as to the cause of the kernel cpu usage, but from the numbers i do have from AA's vmstat, they are much higher in Rik's vm than in Andrea's. That and the fact that Rik's vm seems to be doing the right thing whereas Andrea's is having to fix mistakes yet Rik's loses seems to tell you that i'm not wrong in thinking that it's the vm's cpu usage that is the culprit.
Quoted 7 lines
also, if you merely sum the SI and SO columns for each:
sum(SI) sum(SO) sum(SI+SO) Rik-VM 43564 317448 290032 AA-VM 118284 171748 361012to me, this looks like the same point: Rik being SO-happy, Andrea having to SI a lot more. interesting also that Andrea wins the race, in spite of poorer SO choices and more swap traffic overall.
Just cause I didn't see anybody mentioned it yet: your statement is not valid you switched the SI+SO values. It's 361012 for Rik-VM and 290032 for AA-VM (easy to see as SO for Rik-VM is higher than the sum for Rik-VM in your table ;-) ). So AA makes less swap traffic overall which does actually explain at least partially why it wins the race.
Regards,
Dirk Moerenhout ///// System Administrator ///// Planet Internet NV