[Sussex] Microsoft Windows minimum system's

Steven Dobson steve at dobson.org
Tue Aug 8 10:44:47 UTC 2006


DCB

On Tue, 2006-08-08 at 09:30 +0000, d binderman wrote:
> > IIRC, Linux does not allocate a page in swap unless it needs to swap a
> > RAM page to swap.  Therefore a system with more RAM than need by the
> > applications running will not need to swap.  You should see no
> > perfromance difference between a system configured with swap and one
> > configured without.
> 
> Not quite. On Linux, if it has less RAM than it needs, it will swap.
>
> OTOH, if the machine has more RAM than the running applications
> need, the rest of RAM is used as a disk cache, leading to better
> performance for those machines with larger RAM.

Apart from "Not quite" none of those states is in conflict.  Your
statements talk about what will happen when the system runs out of RAM
and mine talks about _how_ it will cope with running out of RAM.

Many moons ago when I did the Solaris System Internals course I recall
(hopefully correctly) that when a application request another page of
RAM the kernel not only allocates it a chuck of memory, but also
allocates the page in the swap where that page of memory will be written
to if needed.  It is built into Solaris that all pages (except for a few
used by the kernel) are always backed up by a page somewhere on disk.

That way the swapper process can merrily go about it's task of writing
dirty (modified) RAM pages to swap.

While this method is efficent because the swapper process is simple and
because the "find free swap page" routine is only called once for each
page it can create bottlenecks.  If pages that needs to be swapped out
are going to a disk which is busy reading or writing for an application
then the writing of a page to swap on that disk will force the disk
heads away from the area where they need to be for best application
performance.  As anyone knowledgable in disk performance will tell you,
moving the heads is the most expensive (slowest) thing you can do.

If you have multiple disks on Linux it is generally a good idea to have
a swap partition on each disk, and to set the priority of your swap
areas to the same level (see swapon(2) for details).  Higher priority
swap area are filled first.  Pages needing to be swapped are grouped
together (where possible) and written as a cluster (a large lump which
is more efficent).  And I beleive it is the case that the least busy
swap disk will be used.

Of course if you want an application to have the best possable disk
performance then dedicate the whole disk (or more than one disk) to that
application and don't put a swap parition on it.

> Suggest try man vmstat or man top sometime.

Neither vmstat(8) or top(1) give details of the implementation.  For
that kind of detail you'll need to read the source.

Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20060808/c57a6ae2/attachment.pgp 


More information about the Sussex mailing list