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.

vps memory issue

Discussion in 'Workarounds and Optimization' started by niceboy, Dec 29, 2012.

  1. niceboy

    niceboy Active Member

    Joined:
    Sep 29, 2011
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Hi,

    I have a vps which seems to be some how eating ram...

    1gb ram
    50gb hdd ssd cached
    cpanel vps

    ### the load is always low..
    09:39:10 up 8 days, 15:02, 1 user, load average: 0.03, 0.09, 0.16

    ### free mem reported..
    free -m
    total used free shared buffers cached
    Mem: 1024 747 276 0 0 747
    -/+ buffers/cache: 0 1024
    Swap: 0 0 0

    My question is, the 2nd line(buffers/cache) in memory report shows 1gb free ram.

    But, as soon as free mem indicated by first line goes below 250 mb, lfd starts failing and i start receiving lfd failed/restarted emails.

    Here is the top -c (with shift M) output..

    Code:
    top - 09:48:30 up 8 days, 15:11,  1 user,  load average: 0.11, 0.07, 0.09
    Tasks:  46 total,   1 running,  45 sleeping,   0 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.1%sy,  0.0%ni, 99.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   1048576k total,   766212k used,   282364k free,        0k buffers
    Swap:        0k total,        0k used,        0k free,   766212k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
      686 mysql     20   0 1068m 106m 3956 S  0.0 10.4  94:06.87 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/us1chicagocl.
    17573 root      20   0  181m  37m 1492 S  0.0  3.7   0:00.73 lfd - sleeping
      523 named     20   0  382m  28m 2348 S  0.0  2.8   1:27.10 /usr/sbin/named -u named
     1360 root      20   0 93100  13m  524 S  0.0  1.3   0:01.04 cpdavd - accepting connections on 2077 and 2078
    14219 nobody    20   0 54692  13m  880 S  0.0  1.3   0:02.74 nginx: worker process
    14218 nobody    20   0 54692  13m  880 S  0.0  1.3   0:01.00 nginx: worker process
    10541 root      20   0 54692  12m  888 S  0.0  1.2   0:00.06 nginx: master process /usr/local/sbin/nginx -c /etc/nginx/nginx.conf
     1343 root      20   0 77480  12m 1836 S  0.0  1.2   0:24.14 cpsrvd (SSL) - waiting for c --llu=1356017813 --listen=3,4,5,6,7,8
    19078 root      20   0 85224  10m 2888 S  0.3  1.0   0:31.70 /usr/local/apache/bin/httpd -k start -DSSL
    14221 nobody    20   0 85880  10m 2004 S  0.0  1.0   0:01.40 /usr/local/apache/bin/httpd -k start -DSSL
    14222 nobody    20   0 85972  10m 1996 S  0.0  1.0   0:01.24 /usr/local/apache/bin/httpd -k start -DSSL
    14229 nobody    20   0 85740 9.8m 2016 S  0.0  1.0   0:01.13 /usr/local/apache/bin/httpd -k start -DSSL
    14225 nobody    20   0 85628 9.8m 2000 S  0.0  1.0   0:01.10 /usr/local/apache/bin/httpd -k start -DSSL
    14224 nobody    20   0 85620 9.8m 2016 S  0.0  1.0   0:01.10 /usr/local/apache/bin/httpd -k start -DSSL
    17002 nobody    20   0 85628 9996 2008 S  0.0  1.0   0:00.32 /usr/local/apache/bin/httpd -k start -DSSL
    16992 nobody    20   0 85620 9984 1996 S  0.0  1.0   0:00.33 /usr/local/apache/bin/httpd -k start -DSSL
    17027 nobody    20   0 85612 9980 1996 S  0.0  1.0   0:00.29 /usr/local/apache/bin/httpd -k start -DSSL
    17146 nobody    20   0 85620 9968 1980 S  0.0  1.0   0:00.26 /usr/local/apache/bin/httpd -k start -DSSL
    17088 nobody    20   0 85612 9952 2000 S  0.0  0.9   0:00.28 /usr/local/apache/bin/httpd -k start -DSSL
    14220 root      20   0 52152 9052 2508 S  0.0  0.9   0:00.06 /usr/bin/perl /usr/local/cpanel/bin/leechprotect
     1454 root      20   0 45464 7668 1664 S  0.0  0.7   2:11.77 tailwatchd
     1385 root      20   0 32424 4788 1308 S  0.0  0.5   0:03.83 queueprocd - wait to process a task
      510 root      20   0  243m 3808  820 S  0.0  0.4   0:12.79 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
    17901 root      20   0 66792 3412 2652 S  0.0  0.3   0:00.02 sshd: root@pts/0
    
    Please help..
     
  2. 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
    The line that includes buffers and cache is what tells you the true amount of free memory. Linux allocates unused memory to buffers and cache, and reallocates it to applications as needed. I explained this in more detail here:

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

    What is in /proc/user_beancounters? Is any value higher than 0 in the failcnt column in that file? (You did not mention which virtualization environment you are using. /proc/user_beancounters will only exist in Virtuozzo and OpenVZ.)

    If the only thing you see failing is lfd, then I recommend contacting its developer, ConfigServer, for help with it. lfd is not our product and we do not provide support for it. ConfigServer's support contact information is here:

    Way to the Web Technical Support
     
  3. niceboy

    niceboy Active Member

    Joined:
    Sep 29, 2011
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Yes it is openvz. Here is cat /proc/user_beancounters output..
    Code:
    Version: 2.5
           uid  resource                     held              maxheld              barrier                limit              failcnt
        22403:  kmemsize                168293076            318582784           2147483647           2147483647                    0
                lockedpages                     0                    8                 2560                 2688                    0
                privvmpages                199144               263168               262144               263168                 1493
                shmpages                      664                 1320                 8192                 8192                    0
                dummy                           0                    0                    0                    0                    0
                numproc                        65                  129                 1000                 1020                    0
                physpages                  741059              1489389                    0  9223372036854775807                    0
                vmguarpages                     0                    0               262144               262144                    0
                oomguarpages                68021               122558               262144  9223372036854775807                    0
                numtcpsock                     33                  106                 2000                 2000                    0
                numflock                        2                   13                  800                 1000                    0
                numpty                          2                    3                   32                   64                    0
                numsiginfo                      0                   30                 1024                 1152                    0
                tcpsndbuf                  635240              3798144           2147483647           2147483647                    0
                tcprcvbuf                  540672              4710024           2147483647           2147483647                    0
                othersockbuf                71920              1376672           2147483647           2147483647                    0
                dgramrcvbuf                     0                23120           2147483647           2147483647                    0
                numothersock                   73                  101                 1200                 1250                    0
                dcachesize              156947612            300552354           2147483647           2147483647                    0
                numfile                      1999                 2955           2147483647           2147483647                    0
                dummy                           0                    0                    0                    0                    0
                dummy                           0                    0                    0                    0                    0
                dummy                           0                    0                    0                    0                    0
                numiptent                     424                  424                 4096                 4224                    0
    
    I can see that privvmpages is showing 1493 value. What does that imply? How to tweak my vps memory use?

    thanks for help
     
  4. 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
    It means that the server has failed its privvmpages limit 1493 times. In short, the failcnt value for privvmpages means your VPS is running out of memory. You will need to ask your VPS host if that value can be increased for your VPS.
     
  5. niceboy

    niceboy Active Member

    Joined:
    Sep 29, 2011
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    But according to your thread http://forums.cpanel.net/f34/memory-usage-apparently-higher-than-expected-308861.html explanation, my vps is having full 1gb free memory as everything is cached..

    total used free shared buffers cached
    Mem: 1024 747 276 0 0 747
    -/+ buffers/cache: 0 1024
    Swap: 0 0 0

    What we are saying here is, we are not using(or using minimum) memory, but some how, the vps host has set a memory limit value which is already crossed 1493 times!

    I assume this should be the mistake with vps host..

    May I please have your opinion on this..?

    Thanks for great help.
     
  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
    This is an administration issue that you really need to discuss with your hosting provider.

    If lfd is the only thing that is actually failing, then contact ConfigServer, its developer, for help with lfd.
     
  7. srpurdy

    srpurdy Well-Known Member

    Joined:
    Jun 1, 2011
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    if you look at your bean_counters
    199144 * 4 = 796756 (which is how much memory your using in KB

    basically
    1048576k total / 4 = 262144 and if you look at bean_counters this number is the "barrier" this is privpages.

    So doesn't matter if it's cached privpages will go up, and it looks like your VPS has no burst memory so if it goes over at any point at all it will gointo failcnt.

    So like was mentioned it's your hosting provider either needs to provide more memory. or you need to lower memory usage.

    Also if you look at max_held 263168

    263168 * 4 = 1052672 and this is greater than 1048576 which means at some point your top screen where it shows 766212k used went to 1052672K used
     
    #7 srpurdy, Jan 5, 2013
    Last edited: Jan 5, 2013
Loading...

Share This Page