[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Swap



  In general you should never use much swap.  You only need swap when
you are trying to use more memory than you have.  For a normal
workstation 128M of swap is more than enough.  I generally limit myself
to 64 megs per drive.  On the other hand a server might run into
situations where it might need to swap.  Even in this case having more
swap than memory is not really useful as your hard drive is far to
slow.  Any time you are paging and swapping your machine will slow to a
snail's pace.  

   I typical run a machine with 192 megs, and a only 64 megs of swap.
(32 on each disk)  Typical only about 3000K is swaped out, and 3000K
main ram is free.  (Of course the vast majority only ram is used as
buffer cache which can easily be reused.)  The only case you'd need more
than 64 megs of swap is when you are dealing with large data sets.  A
great use of swap is one where you are accessing virtual memory
sequential.  In this case it's slower than ram, but as the drive head
isn't read a bit here and there it's okay.  RAM is always better because
it doesn't matter what order you access data in it's always just as
fast.

  On the other hand having 2 64 meg swap partitions on 2 different
drives is oftenbetter than having a single 128 meg partition.  (Unless
of course one disk is used very heavily.)  Linux will split the data up
between swap devices and function in some respects like a RAID 0 array.
(This is a gross simplification.)  Don't split up swap to multiple
partition on 1 disk, however that will make things worse.  Of course if
you're running RAID things get much more complex. We could go on all day
on load balancing drive access, but it's friday night guys.


  In general if you are useing a large amount of swap get more memory. 
Take a look at your system with top:
Mem:  257372K av, 253484K used,   3888K free,  90732K shrd,  19844K buff
Swap: 262240K av,   3772K used, 258468K free                133388K
cached   
(Note this system was loaded by someone with the swap >= ram mentality
from the bad old days when Un*xes needed swap to assign when it assigned
memory.  So you needed more swap than memory in order to be able to
swap.)

Yes I'm using swap a little. Linux will always use a little bit of
swap.  Note, however that nearly 200 megs of main memory are being used
for buffer cache.  This is really free memory for the most part.  It's
good, because my machine rarely needs to read from the hard drive if
it's accessed the data before.  I'd down grade my cpu's before down
grading memory.

Aaron wrote:
> 
> With all this talk about swap
> 
> I was curious as to what benefits people have been getting out of more swap space
> 
> I can imagine what they might be
> 
> but how does that relate to performance?
> 
> I have 128m of swap and 128m of real ram
> 
> but I have enough disk to add another 128m of swap, but does it really help that much?  I don't have problems running out of swap so I wouldn't think I needed more, but does having multiple help any?
> 
> Aaron
> -----
> I've never felt better
> and had less
> -Harry Caray
> 
> --
>   PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
>                 http://www.redhat.com http://archive.redhat.com
>          To unsubscribe: mail redhat-install-list-request redhat com with
>                        "unsubscribe" as the Subject.

--
Be a responsible motor-cyclist.
Be an organ donor.
Samuel Flory sflory varesearch com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]