Wandering Thoughts archives


Sizing your swap space (part 2)

On modern machines, the temptation is to make heroically big swap sizes; you'll hardly notice giving your swap 5G or 10G, and it means that you can just forget about the whole worry that you've made it too small. But this can be counterproductive, because too much swap can be dangerous.

The problem with a too large swap is that it lets your system thrash itself more and more into overload, instead of outright exploding and then recovering. When a system is overloaded enough, it is simply not going to recover on its own in a reasonable amount of time, because everything is too busy paging things in to make much progress; the only way out is to do something drastic, like kill programs off and start over.

Once your system gets into this state, swap space is just rope to hang it with; the more swap space, the more rope and the longer the situation is going to continue. (Generally when things get this overloaded, the situation feeds on itself and things get worse and worse.)

So what you really want is enough swap space that your system can survive a temporary emergency long enough for you to kill the runaway process or the like, but not so much swap space that it can keep going and bog down in the mud.

(In the peculiar world of software, it is generally faster to blow the vehicle up and rebuild it from scratch than to patiently dig it out of the mud.)

sysadmin/SwapSizingII written at 22:04:12; Add Comment

Page tools: See As Normal.
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.