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



On Fri, 07 Dec 2007 11:55:09 +0100 Spoon <root@localhost> wrote:
| phil wrote:
|
|> 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.
|
| It might be possible to tune your system using some of the vm knobs
| (cf. /proc/sys/vm) documented in filesystems/proc.txt
|
| http://lxr.linux.no/linux/Documentation/filesystems/proc.txt
| http://www.linuxinsight.com/proc_sys_vm_hierarchy.html
|
| block_dump
| dirty_background_ratio
| dirty_expire_centisecs
| dirty_ratio
| dirty_writeback_centisecs
| drop_caches
| laptop_mode
| legacy_va_layout
| lowmem_reserve_ratio
| max_map_count
| min_free_kbytes
| nr_pdflush_threads
| overcommit_memory
| overcommit_ratio
| page-cluster
| panic_on_oom
| percpu_pagelist_fraction
| swap_token_timeout
| swappiness
| vdso_enabled
| vfs_cache_pressure
|
| cf. also /proc/meminfo and /proc/vmstat
|
| http://www.linuxinsight.com/proc_vmstat.html

I'm already going ahead and will be doing the no-swap system by having as
much additional RAM as I would have in swap space. I'm not interested at
this point in going back to a traditional RAM+swap and trying to tune it
to better performance. I have found other benefits to eliminating swap
in addition to what I believe will be better performance if added RAM in
the amount that would be swap space is included. One such benefit is not
having to use CPU time to encrypt/decrypt swap pages in a system that will
be made tightly secured. So my interest is in how to tune a system that
has no swap space. Documents that specifically consider a non-swap system
would be the ones of interest.

My older computer currently has 512MB of RAM and 2GB of swap space. It has
never run out of memory in normal operation. That would suggest 2.5GB of
RAM would be sufficient to avoid an out of memory with the current software
and usage patterns. That computer, however, is capped at 512MB due to the
chipset, and is limited to older slower CPUs. So thus, the new computers
are being built as parts are being purchased and arrive, around a Tyan
S2927A2NRF motherboard that supports up to 32GB of ECC RAM. I plan to put
8GB of RAM in it.

Later, with a 2nd machine, I will carry the experiment to the next level
and organize the system to have all executables and run time libraries
preloaded into RAMFS, after expanding the RAM capacity further by at least
the amount loaded into RAMFS. I will also try TMPFS in place of RAMFS to
see if it has any real difference (maybe more overhead, but with no swap
in the system, it fundamentally should be not much different).

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



Relevant Pages