An interesting article about Xen and swapping
5 Replies
FWIW, "swap = twice RAM" wasn't a myth. On older BSD systems (eg SunOS 4 and of the like; we're talking a decade old) swap was allocated in a much different way; every program running must have swap space available to swap it to, so you can never run more than the amount of swap space you had. So 16Mb RAM and 16MB swap only resulted in 16MB of VM space available! 16MB RAM and 32MB swap meant 32MB VM. Thus "swap = twice RAM" made a good rule-of-thumb. Performance still went to hell when swapping that badly; it was designed to let your SA do emergency work
(see
However this has NEVER been true on Linux. And I don't think it's true on any system, any more. The equivalent rule of thumb these days would be "swap = RAM", but you'll still suffer crap performance if you swap too much.
So… "swap = twice RAM" is not a myth. But it's now an old out-of-date rule of thumb that people ignorantly repeat because they didn't know why the rule existed.
I certainly like the idea of isolating swap storage to a separate physical disk on the dom0 (this main focus of the article). Even if all domU clients shared a single disk for swap it would punish the thrashers and prevent them from effecting well-behaved clients too much.
It would be cheap to implement too. Seeing as most people allocate swap space somewhere in the range of RAM to 2 x RAM it wouldn't need to be a very big disk. Good use for retired main storage drives.
Of course, this would all require some changes to the way Linode works. Currently you have one bucket for storage and can divide it up as you see fit. Also, you can swap to a file in one of your filesystem partitions. It's not clear to me how to prevent that… plus there can always be disk contention that's not related to swap at all.
Interesting discussion though!