Aaron Konstam wrote:
On Wed, 2007-05-16 at 17:58 -0600, Phil Meyer wrote:
Many automated tools used to assume swap == 2xRAM
This is not true of any modern UNIX system, including Linux.
Linux does not need any swap at all to run.
Very few applications still force swap to exist before loading
(Oracle
still does I think).
I agree with the tenor of you argument except to say that Linux does not
need swap is a little to strong a statement. Linux may run without swap
but not well if you are running large programs that are not compute
intensive.
Ya, my ability to articulate specifics is ... missing? :)
Perhaps it could more accurately be stated as:
Linux (the kernel itself) does not need swap to come up and run.
Linux (the general layer of applications) does not need swap to run
UNLESS the specific application requires it,
or
the collection of running applications will exceed physical RAM.
Do I ever advise running without swap? No. Not even on the embedded
systems we are building here. Its not worth the risk.
It is always best to allocate enough swap for the applications that may
need it.
If the applications are not known, such as a generic developer
desktop/laptop? I always build those with 2GB swap. Why?
1. 32bit safe
2. Even with laptops now days, 2GB is a small percentage of the whole
drive.
3. Long experience shows that not a single desktop/laptop, that I have
built, *ever* has exceeded the 2GB swap requirement. This also applies
to the *many* Solaris based desktops I have built.
For servers, however, it is always wise to take a hard look at the
applications involved before specifying swap space.
In my experience, the 2GB specification has always been 'good enough'
for DNS servers, Apache servers, and many other single application
dedicated servers.
Database servers cannot be generically specified by vendor because a
many instance server is totally different from a single instance server.
Mail servers can have spam and virus filtering with databases for both
of those activities, as well as outbound mail services. Each one of
those needs to be analyzed before allocating swap.
Larger systems such as a SAP server, or an Oracle Financial server, also
need to have swap sized specifically for the environment they will run in.
YMMV