> If you run "free" or "top" on your system (assuming linux)... Soon > after > booting, you'll see lots of free memory. But if your system has been > up for > a week, you'll see zero free memory, and all the rest is consumed by > buffers.
If you see the number of buffers has gone to zero - then you are pushing your system beyond its ram capabilities, and you should either upgrade your ram, or find a way to decrease your userspace ram usage. If you see the number of buffers has gone to zero - and the consumed swap is growing - then you are thrashing, and should seriously fix it. THAT will kill you. If you see the number of buffers is not near zero - then you know you are not thrashing, and therefore not in the "danger" zone. Here, it is ok to consume swap. If you see the number of buffers is not near zero - and the swap usage is higher than zero - then you know at some point you got a performance boost by swapping out idle processes instead of dropping important disk blocks out of cache. The best way to decide how much swap you should have available is: Take a bunch of samples on live systems. Continually monitor over time, during normal usage. You'll see a clear pattern, similar to this: In my systems during periods of extended idle time (vacations & holidays etc) my swap ranges anywhere up to 1G. During normal usage, it ranges from 512M to 2G. Occasionally in normal usage, some machines will consume as high as 6G, and the only time it has ever reached 8G or higher was when some user accidentally had a runaway process. And then draw your own conclusions... Personally, I don't have real data such as the above, because disk space is so cheap, who cares if I give it more swap than it needs. If it can't benefit from using it, it won't use it. And as long as the buffers stays significantly nonzero, I know I'm not thrashing, so I might as well let the system consume all the swap it wants. It's a nice way to allow zombie processes to sit harmlessly on a shelf. I therefore conclude, I give all systems at least 16G of swap. If a user has a runaway process thrashing, the system will all but halt, and I'll simply reboot it. The only ground you have to gain by shrinking the size of swap is: Whenever a user process runs away, it's kind of nice for it to die on its own instead of rebooting the system. Since all my machines where memory intensive jobs run are intended for queued jobs only, I don't care. No users interactively logged in = Just reboot it. It's easy. _______________________________________________ Tech mailing list [email protected] http://lopsa.org/cgi-bin/mailman/listinfo/tech This list provided by the League of Professional System Administrators http://lopsa.org/
