Server Not Loaded But Swapping

A

aisagtr

Guest
We have a Core2Duo 2.2 and the stats are as follows:

Cpanel 11 Stable on CentOS 5

Our server load is normally 0.7 (2 cpus)
Memory usage is 20%

We have never experienced any spike in load but our SWAP is always at 5% to 10%

This is very weird as we have enough RAM.

What could be the cause, please?

HTTPD.CONF is setup as follows:

Keepalive = Off
MinServers = 38
MaxServers = 58
StartServers = 88
Max Clients = 256

MaxRequestsPerChild = 10,000
 
Last edited by a moderator:

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
15
313
Houston, TX
cPanel Access Level
Root Administrator
Note that not all OSs/distros will wait for physical RAM to be filled before using swap.

A technique employed in some environments is that the OS determines what is likely to only be used on rare occasion and throw that into swap (even if physical RAM is available). This leaves physical RAM available should it need to all be used very quickly. Also, it eliminates the need to move this stuff to swap at a later time (likely when the system is under more strain) as it is already in swap.

So it doesn't necessarily mean anything is wrong :). I understand myself, I like to have as much stuff in physical RAM as I can due to improved I/O performance. I got annoyed when I started putting tons of RAM in my systems and saw available physical RAM when swap was being used. Now that I understand why that happens, I have a tendency to agree with how some Operating Systems allocate swap vs. physical RAM.
 
A

aisagtr

Guest
Thanks!

Most informative but it does slow the server down somewhat?
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
15
313
Houston, TX
cPanel Access Level
Root Administrator
Thanks!

Most informative but it does slow the server down somewhat?
From a theoretical perspective, I would assume there is some slowdown. However, in practice I haven't noticed a performance hit large enough for me to notice. Then again, if something goes from being rarely used to being frequently used (or vice versa), the OS typically will adjust things accordingly.
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,217
4
193
Minneapolis, MN
Most informative but it does slow the server down somewhat?
During the initial setup of your server, how many Memory RAM do you have on your server, and how many MBs did you assign to SWAP?
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
May be no help at all, but I posted to this thread a while back about mod_security.

http://forums.cpanel.net/showthread.php?t=71838&highlight=mod_security

I had seen some load and swapping when I didn't think there should have been and tracked down the comments at gotroot. (linked from that thread above) I played around with my rulesets and was able to eliminate the swapping I had.

YMMV