[CentOS] Shrinking a volume group

Steve Bergman steve at rueb.com
Wed Sep 13 14:12:11 UTC 2006

On Wed, 2006-09-13 at 06:23 -0500, Aleksandar Milivojevic wrote:

> The best performance is if you don't swap at all.  Avoid swapping, don't 
> relay on "fast swap".  There's no such thing as "fast swap" ;-)
> Anyhow, theoretically when you read from RAID1, you read different pages 
> from different drives in parallel.  That's why RAID1 theoretically has 
> two times faster reads than single drive.  Writing to RAID1 is 
> theoretically the same speed as writing to single drive.

Hi Aleksandar,

Yes, you are right.  I had forgotten about that.  Just having a blonde
day yesterday, I guess.

Since swapin performance is more important than swapout, I really do
have the best of both worlds  the way things are set up.

When it comes to swap, I'm a big believer that swap is a good thing.
I've been reviewing this discussion on lkml:


My thinking is squarely in the Andrew Morton camp:


"""Swapout is good.  It frees up unused memory.  I run my desktop
machines at swappiness=100."""


"""My point is that decreasing the tendency of the kernel to swap stuff
out is wrong.  You really don't want hundreds of megabytes of
BloatyApp's untouched memory floating about in the machine.  Get it out
on the disk, use the memory for something useful."""


Though if the maximum latency muust be kept below a certain value, I can
see where one might want to completely avoid swap.

Of course, if a machine has *so* much memory that it *can't* use all
available memory.  i.e. the memory used by apps + the total amount of
data read from disk <= physical memory, that would indeed be optimal.

What I have is:

2 Pentium 4 Xeons.  3.2Ghz, Hyperthreaded, 2MB L2 per processor
4GB physical memory
2 250GB SATA drives on separate SATA channels

running 40 Gnome desktops + 100 instances of a character based point of
sale and accounting app.  Plus samba file server, lightly loaded
database server, lightly loaded intranet web server/Ruby on Rails app

Typically, I have about 300MB in swap with very little swapin occurring
and about 700MB cache, 50mb buffers.

But as I've been told by one employee that they have noticed that one of
the major incentives for other employees to choose to switch from their
Windows desktop to a Linux desktop (via XDMCP) is the greatly improved
speed, I'm interested in keeping it optimal as the load increases.

I'm considering running the swappiness value higher.  But I do start
seeing some significant swapin at swappiness=100. (Typically, from 0 -
50 pages /sec averaged over 10 minutes according to systat/sar.

That was what got me to thinking about how I had set up the swap.

However, even at 50 p/s, that only represents 200k/s i/o which seems
pretty trivial.

I'm going to try a full day at swappiness=100 today and see how things
look.  I'll be NX'd into the machine my self doing some development
work, which is about the best metric I can come up with.  It's so very
hard to come up with good solid metrics when it comes to this kind of


More information about the CentOS mailing list