An interesting article about Xen and swapping

I just thought I'd share this with you:

http://etbe.coker.com.au/?p=735

5 Replies

This totally looks like forum spam, but I braved it and it's legit.

The whole etbe blog is pretty interesting.

The swap issue is well known on linodes. The UML IO tokens system helps mitigate this to some extent ( a UML linode swapping intensively will run out of I/O tokens and so no longer chew up host I/O bandwidth, freeing the other linodes on the same host to continue on as normal).

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 http://sunsite.uakom.sk/sunworldonline/ … -perf.html">http://sunsite.uakom.sk/sunworldonline/swol-04-1996/swol-04-perf.html for more details on this).

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've been bitten by bad neighbors on several of the Linode hosts we have used. There's not much the staff are able to do unless you raise a ticket when it happens. That or move you to another host, which is not a feasible solution for everyone – can't give the whole host over to the thrasher, right?

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!

For those that don't recognize the name, Russell Coker is a long-time Debian maintainer and all-round smart guy.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct