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

Discussion in 'Site & Server Administration' started by basketmen, Jan 21, 2011.

  1. #1
    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, Jan 21, 2011 IP
  2. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    #2
    Swap is used when your physical ram usage is so high or there is a memory leak in your processes.

    You can disable swap by following command until you reboot to test

    swapoff -a

    To enable

    swapon -a
     
    st1905, Jan 22, 2011 IP
  3. basketmen

    basketmen Well-Known Member

    Messages:
    837
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #3
    thanks maybe i will try it


    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
    [​IMG]




    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
    [​IMG]





    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
     
    basketmen, Jan 22, 2011 IP
  4. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Ok, it looks like you are using suphp and its causing issues with the memory usage (Suphp is not good for performance but security) you can switch to DSO and see if this leak continues or not, i suggest you to check the scripts and run strace for the high cpu and memory using processes

    example

    strace -p 2988
     
    st1905, Jan 23, 2011 IP
  5. basketmen

    basketmen Well-Known Member

    Messages:
    837
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    130
    #5
    it is f-cgi, and using xcache


    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 :

    [​IMG]



    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)

    [​IMG]




    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?
     
    basketmen, Jan 24, 2011 IP