[Linux/WHM] How to disable Swap Used? My server sometime get high load when Swap Used

basketmen

Well-Known Member
Sep 9, 2010
128
1
66
My server load normally only about 1 or below, the server running normally for days, not get high load

when i check in whm >> Service Status, the Swap Used report always zero (0), not used at all :

Swap Used 0.00% (0 of 10169104)




but when Swap Used sometime, even the swap used very very small size, only 4k, or 88k like below, the server start sometime get high load, can be few times a day. And to make the Swap Used zero (0) again, i need to Gracefull Reboot

in whm - Service Status :

Swap Used 0.00% (4 of 10169104)
or
Swap Used 0.00% (88 of 10169104)



the Memory Used when Swap Used is only about 25-50%, i believe the memory 8Gb is still big, the problem maybe because the harddrive/harddisk rpm are too slow



please help guys How to disable the Swap Used? so the server only using the memory, not swapped using harddrive/harddisk too





Nb. Here are the server specs :
Core i7 860 Quad Core - SINGLE CPU QUAD CORE 2.8GHZ FSB 2.5 GT/s (8MB CACHE) w/HT
Control Panel: CPanel/WHM - Centos 5 64 Bit
RAM/Memory: 8GB DDR3
Primary Hard Drive: 1TB SATA
 

basketmen

Well-Known Member
Sep 9, 2010
128
1
66
Re: [Linux/WHM] How to disable Swap Used? My server sometime get high load when Swap

up up


usually there are no high load, when Swap Used are 0 (zero), for few days

screenshot when Swap Used are 0 (zero), there will be no high load
i291.photobucket.com/albums/ll284/basketmen/normalload23january.jpg




the high load only come when Swap Used, and i need to Gracefull reboot to make the Swap Used 0 (zero) again

screenshot when Swap Used are not 0 (zero), there will be high load (load can be 20-100) in that day for few minutes/hours, in this screenshot still normal load
i291.photobucket.com/albums/ll284/basketmen/highloadjanuary22.jpg





my temporary analyze the high load is because the Swap Used, so i want to try disable it, let me know if you have another suggestions
 
Last edited by a moderator:

Eric

Well-Known Member
Nov 25, 2007
752
12
143
Texas
cPanel Access Level
Root Administrator
Re: [Linux/WHM] How to disable Swap Used? My server sometime get high load when Swap

If you'd like to turn swap off you can using the command...

swap off

but judging from your screenshots you're not in a bad way. If your cpu idle is at 0% and your IO wait aka "wa" is at 90% that's when you have swap issues.
 

basketmen

Well-Known Member
Sep 9, 2010
128
1
66
Re: [Linux/WHM] How to disable Swap Used? My server sometime get high load when Swap

the high load since few days ago come when off peak time, not peak time, usually at 7-8am (very little people at that time, almost no traffic), you can see here, this is when high load at 8.23am, and the task are very low, only 198, get high load, the Swap used are 8k :

i291.photobucket.com/albums/ll284/basketmen/highloadjanuary23taskonly198.jpg



its not make sense get high load with the task only 198 (very little people at that time, almost no traffic), its very low number, its should be no high load, the server usually running the task at 250 averages and not get high load, if swap used are 0 (zero)




This is current top result, now are peak time, the task are higher : 257, but the load only 0.61, the Swap used are 0 (zero)

i291.photobucket.com/albums/ll284/basketmen/normalload24january.jpg




i am not sure if upgrading the memory from 8Gb right now, to 16Gb will solved the problem

if you have suggestion again for now i really appreciated, maybe like how to set only use swap if memory used 90% or more?, or how to found out which one the script that causing high load?
 
Last edited by a moderator:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: [Linux/WHM] How to disable Swap Used? My server sometime get high load when Swap

Hello,

The load is probably high due to the high CPU and memory for the mobelof user, likely from MySQL usage. The swap isn't the issue here. You'll need to check top every time the load is elevated to see if it's the same user. You can also check WHM > Daily Process Logs to see the average usage by that user for CPU, memory and MySQL.

You might also want to check "mysqladmin proc" to see what MySQL processes that user is likely running during those times. Since that user has multiple PHP processes with high CPU running, it's a sure bet that's the user peaking the load.

You can run an lsof on the PID number of that mobelof user's processes when they show these high usage processes to see what it is running:

Code:
lsof -p PID#
Simply replace PID# with the PID# of the process, which is the one to the far left in top.

You can ps aux to get all that user's processes at the time to get a listing of PID numbers:

Code:
ps aux | grep mobelof
Thanks!