Re: running Linux with no swap space (but lots of RAM)



On Wed, 28 Nov 2007 05:01:00 -0800 (PST) J de Boyne Pollard <j.deboynepollard@xxxxxxxxx> wrote:
| JdeBP> No. It's a very good reason to not swap to the boot device
| JdeBP> on that system, but instead to swap to some other device
| JdeBP> that can tolerate paging I/O. The problem in your
| JdeBP> hypothetical is that the chosen device cannot tolerate the
| JdeBP> I/O, not that the system is paging to disc.
| JdeBP>
| JdeBP> <URL:http://homepages.tesco.net./~J.deBoynePollard/FGA/dont-
| throw-
| those-paging-files-away.html>
|
| e> In that situation it is quite likely that you don't have "some
| e> other device" to swap to. That's probably why you are booting
| e> from flash in the first place.
|
| The problem in your new hypothetical is then that you have no device
| capable of tolerating paging I/O, not that the system is paging to
| disc.

Please explain what you mean by "tolerating paging I/O".

In the case of a hosted system, which is where I'm planning to switch to
swapless operation, the concern is a set of things that include resource
utilization and responsiveness.

A frequent scenario I see happens when my need for memory by user space
programs is below the capacity is available, and would not have even begun
to swap anything. A program is run that will be doing a large amount of
I/O output, such as copying 100+ GB of files between filesystems. The I/O
buffering goes beyond just the pages that are free. The buffering logic
tries to buffer far more of those 100+ GB than needed to keep the writing
drive continuously busy or even to minimize head seeks. The end result is
that other programs that were not immediately in use (for example Firefox,
Thunderbird, and even Xorg itself), get substantially swapped out. That
has two major effects. One, it actually SLOWS DOWN the intended I/O by
utilizing the I/O bus for the swapping when it could have instead been
better utilized for just the intended I/O reading and writing. It's worse
if the swapping partition is on one of the drives participating in the I/O.
Two, when the I/O is complete, and other uses resume, they now lag while
those program have to be swapped back in.

Having a completely separate device for swapping (and nothing but that)
would eliminate a lot of the contentions. But it would not reduce the
problem anywhere near as much as going swapless would.

Adding RAM in the amount of swap would eliminate a great deal of this.
There would still be pages that originate in libraries or executables
that, being never-dirty, would just be abandoned and still have to be
"swapped" back in from their original mapped location. I'd like to find
a way to eliminate that aspect (I have an idea I will explore later).
But even without that, having the sum of my needed RAM space and needed
swap space deployed as all RAM, I believe, will provide me with a more
responsive system that won't be causing additional I/O that slows down
the big I/O that I periodically do.

I'm sure most readers here have the general idea of how RAMFS works.
Think of this as "swapping to RAMFS". The page to be swapped out is
queued for swap ... and nothing happens. It's still in RAM. When it
is needed once again, instead of having to swap it back in, it is still
there in RAM, ready to use.

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2007-11-29-0801@xxxxxxxx |
|------------------------------------/-------------------------------------|
.



Relevant Pages

  • Re: excessive swap-in time
    ... Trying to do it all with RAM is just inefficient. ... I find that does not work well when the swapping is caused by excessive I/O ... Or you could have 5 TB of swap space. ...
    (comp.os.linux.development.system)
  • Re: excessive swap-in time
    ... | physical memory. ... but swap is orders of magnitude cheaper than RAM. ... You will still do more disk I/O than you need to because some pages ...
    (comp.os.linux.development.system)
  • Re: excessive swap-in time
    ... my target is to have enough RAM to do without any swap space at all. ... One problem I have seen, and described elsewhere, is I/O cache/buffer space ...
    (comp.os.linux.development.system)
  • Re: Caching control
    ... of data that are merely going to be written to disk. ... enough to keep the I/O rate going at full speed. ... set into swap. ... 2GB to 3GB of RAM for what I do, not considering the bulk writing. ...
    (comp.os.linux.development.system)
  • Re: Apps swapped out without swap or what?
    ... and I HAVE NO SWAP PARTITION in this computer! ... minute of inactivity or so, the shell had problems responding, I had to ... load pages or otherwise allocate memory. ... might be suffering from conflicting I/O, ...
    (alt.os.linux)