Unix True 64 - Adding swap space, any limits on too much?

This is Interesting: Free IT Magazines  
Home > Archive > Unix True 64 > February 2004 > Adding swap space, any limits on too much?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Adding swap space, any limits on too much?
d jO'nZ'

2004-02-25, 11:34 am

I have a DS20 with 1 gig of memory and only 1.5 gig of swap space. The
system is starting to get bound and run out of memory and swap.

I want to install a 2nd gig of memory and set up additional swap space. I
know from talking with HP I should set swap at least 2x the size of memory.

I want to drop in a hard drive just for swap. It would be much larger than
2x the memory (I'm thinking of a spare 9 gig drive I have). This would be a
simple solution versus repartioning existing drives.

Does anyone know if I can have too much swap space?? I can't think of any
negative issue. If the system needs more space, it would have plenty. I
might see performance issues if I really used all 9 gig, but by that level
of use, I can add more physical memory anyway.

Thanks - Dale


Peter da Silva

2004-02-25, 2:34 pm

There's no such thing as "too much swap space", just "too little RAM".

There are all kinds of guidelines people promulgate about how much swap
space you should have for a certain amount of RAM, and they're all bogus.

Basically, allocate enough swap for the total amount of virtual memory you
expect to need. Buy enough RAM that you don't swap too much.

On Tru64, you need to decide whether you want to use lazy swap or greedy
swap. In greedy swap, every block of memory is assigned a preallocated
block of swap on the default swap partition. This means that you always
have swap to swap out to to make room, but you've got to have at least as
much swap as you have RAM and you have that much less VM. In lazy swap,
swap isn't allocated until you run out of physical memory.

I have not run into any situation where greedy swap was necessary (and in
saying this I am guaranteeing that someone will immediately call me ten
kinds of plain and fancy fool, and I welcome the feedback), but Digital...
I mean Compaq... HP... enables it by default. To turn it off and get an
extra gigabyte of VM, remove /sbin/swapdefault and reboot.

> I want to drop in a hard drive just for swap. It would be much larger than
> 2x the memory (I'm thinking of a spare 9 gig drive I have). This would be a
> simple solution versus repartioning existing drives.


I would recommend having a swap partition at least the size of memory on
each drive, and lazy allocation... this will give you the best performance
because the system will spread the swapped-out blocks among all the drives
so as to maximize the available bandwidth. If you have a few old 2G or 4G
drives around, and places to put them, use a few of them instead of a
single 9G... even if they're individually slower you're likely to get better
overall performance.

If you want to keep greedy allocation, you need to point /sbin/swapdefault
(it's a symbolic link) to the largest swap partition.

But remember the bottom line: virtual memory is determined by your total swap
space. Real memory is just cache for swap.

--
I've seen things you people can't imagine. Chimneysweeps on fire over the roofs
of London. I've watched kite-strings glitter in the sun at Hyde Park Gate. All
these things will be lost in time, like chalk-paintings in the rain. `-_-'
Time for your nap. | Peter da Silva | Har du kramat din varg, idag? 'U`
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com