Re: efficacy of Linux w/o swap

From: Robert Redelmeier (redelm_at_ev1.net.invalid)
Date: 05/16/05


Date: Mon, 16 May 2005 15:24:49 GMT

phil-news-nospam@ipal.net wrote:
> I'm wanting to put together a machine to do a single
> dedicated purpose that will use Linux and commodity hardware.
> The purpose would be to drive a firewire based digit video (DV)
> encoder/decoder much like a PVR, but in this case somewhat
> different in functionality. However, in this case, unlike a
> PVR, performance is an absolute must. The video stream must
> be input or output continuously without any loss. In order to
> achieve that goal I'm expecting the process doing the actual
> work would have to be locked into RAM to be sure it doesn't
> ever fail to get it's needed CPU cycles to keep the stream going.

I suppose you could lock into RAM, but that eats more memory.
You might have to if you have some seldom-used functions that
still require lowlatency (cannot stand reload from disk).

Personally, I set up any demanding, high performance box as
swapless and get ruthless on the tasklist.

For something with high disk demands, I wouldn't let
anything pre-empt them. And the kernel swapping would.

> When I tested these scenarios with swap disabled, things
> actually got worse, rather than better. It seems the caching
> still was being done, but this time the kernel choked
> on RAM being totally full and spent large amounts of CPU
> doing some kind of activity looking for available pages.
> The way I observed this was through virtual console (X was
> not running) switching. When I was in tty1 and pressed
> Alt-F2 to go to tty2, it would pause and not switch for
> quite some time, then evetually complete the switch.
> Worst case event took 2.5 minutes.

Wow! I've never seen things that bad. It sounds like
there is _a lot_ of data hitting the box, and either
it cannot process or save it away fast enough.

You do have your partitions mounted `noatime`? This is
expecially important with large number of files or deep
directories.

-- Robert