The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

running out of ram

Discussion in 'General Discussion' started by CpNooby, Dec 16, 2012.

  1. CpNooby

    CpNooby Registered

    Joined:
    Dec 16, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have to reboot the server every 24 to 48 hours due to the server using all the ram
    can someone help me out please it looks like cpanel is using up lots and the clamd is just a hog for ram.

    cat /proc/user_beancounters

    Version: 2.5
    uid resource held maxheld barrier limit failcnt
    101: kmemsize 664408697 665251840 214 7483648 2147483648 0
    lockedpages 8187 8190 524288 524288 0
    privvmpages 150000 325664 922337203685 4775807 9223372036854775807 0
    shmpages 663 999 922337203685 4775807 9223372036854775807 0
    dummy 0 0 0 0 0
    numproc 106 195 922337203685 4775807 9223372036854775807 0
    physpages 690915 696152 0 1048576 0
    vmguarpages 0 0 922337203685 4775807 9223372036854775807 0
    oomguarpages 66460 68438 922337203685 4775807 9223372036854775807 0
    numtcpsock 42 115 922337203685 4775807 9223372036854775807 0
    numflock 8 19 922337203685 4775807 9223372036854775807 0
    numpty 1 2 922337203685 4775807 9223372036854775807 0
    numsiginfo 0 27 922337203685 4775807 9223372036854775807 0
    tcpsndbuf 734792 3270528 922337203685 4775807 9223372036854775807 0
    tcprcvbuf 688128 1884160 922337203685 4775807 9223372036854775807 0
    othersockbuf 116624 438376 922337203685 4775807 9223372036854775807 0
    dgramrcvbuf 0 82432 922337203685 4775807 9223372036854775807 0
    numothersock 117 162 922337203685 4775807 9223372036854775807 0
    dcachesize 655612972 655685726 107 3741824 1073741824 0
    numfile 1456 1985 922337203685 4775807 9223372036854775807 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    dummy 0 0 0 0 0
    numiptent 80 80 922337203685 4775807 9223372036854775807 0


    top report

    top - 04:34:42 up 1 day, 19:56, 1 user, load average: 1.19, 1.30, 1.24
    Tasks: 59 total, 1 running, 58 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.7%us, 3.1%sy, 0.7%ni, 83.2%id, 11.6%wa, 0.0%hi, 0.0%si, 0.7%st
    Mem: 4194304k total, 4191300k used, 3004k free, 0k buffers
    Swap: 0k total, 0k used, 0k free, 3760880k cached

    Do you see anything wrong here I’m new and need to learn as much as i can but this is stumping me this is a friend’s server that is bogging out that i have been trying to host a teamspeak server off of but it keeps crashing.

    i have just set up a New server with the following info
    my server with centos 6.3

    top report

    top - 18:07:23 up 7 days, 16:59, 2 users, load average: 0.30, 0.16, 0.22
    Tasks: 269 total, 2 running, 267 sleeping, 0 stopped, 0 zombie
    Cpu(s): 7.5%us, 1.0%sy, 0.0%ni, 91.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 5853.430M total, 5261.309M used, 592.121M free, 148.098M buffers
    Swap: 5983.992M total, 576.000k used, 5983.430M free, 3421.371M cached


    this is after installing cpanel but before that i had this

    top - 00:08:58 up 4 days 3:15, 3 users, load average: 0.62, 0.38, 0.15
    Mem: 5853.430M total, 1800.816M used, 4052.613M free, 71.371M buffers
    Swap: 5983.992M total, 0.000k used, 5983.992M free, 859.457M cached

    what is possibly using all this ram ?
     
  2. PenguinInternet

    PenguinInternet Well-Known Member
    PartnerNOC

    Joined:
    Jun 20, 2007
    Messages:
    149
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Cardiff, UK
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Linux will often use all of your RAM for caching, etc - it will release it as applications then require it. This is perfectly normal. We have a number of servers for example with 24Gb of RAM in them and they are very lightly loaded, but they are using 23Gb. It also shows that your server isn't struggling with this as it's not using SWAP, which is a good thing.
     
  3. kdean

    kdean Well-Known Member

    Joined:
    Oct 19, 2012
    Messages:
    262
    Likes Received:
    12
    Trophy Points:
    18
    Location:
    Orlando, FL
    cPanel Access Level:
    Root Administrator
    For a better idea of your available RAM, instead of running "top", run "free" instead.

    You should see a result similar to:

    Code:
                 total       used       free     shared    buffers     cached
    Mem:       7906544    6678132    1228412          0     743984    3888388
    -/+ buffers/cache:    2045760    5860784
    Swap:      8368120       6256    8361864
    
    The free amount on the "-/+ buffers/cache" line is you actual available RAM if your apps need to take memory from the Linux cache. So, while I have 1228412 free, 5860784 is actually available if needed.
     
    #3 kdean, Dec 16, 2012
    Last edited: Dec 16, 2012
  4. CpNooby

    CpNooby Registered

    Joined:
    Dec 16, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Mr PenguinInternet ( thank you for letting me know everything looks good) but i am just confused and trying to understand what happens to all the ram.

    Before i installed Cpanel i had the same running on the server (Teamspeak) and the server Tasks of 250 tasks were most are not even needed but im experimenting with the install.

    Before i have the following info that claims

    [root@ns1 ~]# top
    top - 01:32:21 up 11 days, 4:22, 2 users, load average: 0.00, 0.00, 0.00
    Tasks: 250 total, 1 running, 249 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 5993912k total, 2306300k used, 3687612k free, 94664k buffers
    Swap: 6127608k total, 0k used, 6127608k free, 1063880k cached

    Right after i install cpanel everything is gone

    top - 19:21:04 up 18:13, 5 users, load average: 0.01, 0.03, 0.00
    Tasks: 273 total, 2 running, 271 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.7%us, 1.2%sy, 0.0%ni, 98.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 5853.430M total, 5046.301M used, 807.129M free, 152.383M buffers
    Swap: 5983.992M total, 576.000k used, 5983.430M free, 3397.117M cached


    root@ns1 [~]# free
    total used free shared buffers cached
    Mem: 5993912 5166920 826992 0 156052 3478648
    -/+ buffers/cache: 1532220 4461692
    Swap: 6127608 576 6127032

    So If i may ask does cpanel reserve the ram or is it using it because on my other server it crashes once the ram is all used, If i reboot the server it clears out the ram and then it gradually gets used till its all used up and i have nothing left hence the crashing of the server every 48 to 72 hours. i have a teamspeak server hosted with 512 slots and about 100 users. before the install the server has never crashed and now its down every 3 days. it was installed before cpanel.
     
  5. MaestriaNick

    MaestriaNick Well-Known Member

    Joined:
    Aug 6, 2008
    Messages:
    159
    Likes Received:
    3
    Trophy Points:
    18
    Can you try to sort top result by memory to see what process / processes using most of the resources. To get top result sort by memory , use top -m if that not working , use top command, then there "shift +F" , then type n (to sort by memory )
     
  6. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Linux uses free RAM for buffers and cache. cPanel does not do this. It is the Linux kernel that does this. It deallocates RAM from buffers and cache and reallocates it to applications as necessary. This can make it look like the server is out of RAM when it is not. It is generally a good thing that the Linux kernel does this, because it speeds up disk I/O operations.

    Please look at this thread for a detailed explanation of this, with links to some very detailed explanations of what is happening:

    http://forums.cpanel.net/f34/memory-usage-apparently-higher-than-expected-308861.html

    Your server may yet actually run low on RAM, but you need to use the free command and look at the correct item reported before coming to that conclusion.
     
Loading...

Share This Page