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.

What's using my RAM?

Discussion in 'General Discussion' started by GoWilkes, Feb 1, 2015.

  1. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    This is in reference to a virtual server with GoDaddy.

    I'm seeing that my RAM is reaching 100% regularly, even at 4am, so there's got to be something running that's taking up all of the resources. The CPU load is fine, it's just the RAM load.

    And "top" doesn't show anything out of the ordinary. The highest %MEM there is 8.7, for MySQL:

    Code:
    /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/ip-xx-xx-xx-xxx.ip.secureserver.net.err --open-files-limit=4342 --pid-file=/var/lib/mysql/ip-xx-xx-xx-xxx.ip.secureserver.net.pid
    
    I've looked at everything I can think of; the last MySQL commands, top processes, IP connections, etc, and can't find any reason for the high RAM load.

    How can I track this down further to find exactly what's taking up all of the RAM?
     
  2. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Just as an update, I'm seeing 100% of my RAM being used all day:

    Code:
                 total       used       free     shared    buffers     cached
    Mem:          1024       1024          0          0          0          0
    -/+ buffers/cache:       1024          0
    Swap:            0          0          0
    
    I've updated cPanel, MySQL, used tuning-primer.sh to optimize everything, gone through Apache config with a fine tooth comb... nothing. I'm getting the same results after a graceful reboot, too, so I suspect that this is a configuration issue, not an attack.

    I installed memcached about an hour ago, but so far it doesn't seem to have had an impact.

    Update: rkhunter found no problems.

    Update 2: Results of meminfo:

    Code:
    # cat /proc/meminfo
    MemTotal:      1048576 kB
    MemFree:             0 kB
    Buffers:             0 kB
    Cached:              0 kB
    SwapCached:          0 kB
    Active:              0 kB
    Inactive:            0 kB
    HighTotal:           0 kB
    HighFree:            0 kB
    LowTotal:      1048576 kB
    LowFree:             0 kB
    SwapTotal:           0 kB
    SwapFree:            0 kB
    Dirty:               0 kB
    Writeback:           0 kB
    AnonPages:           0 kB
    Mapped:              0 kB
    Slab:                0 kB
    PageTables:          0 kB
    NFS_Unstable:        0 kB
    Bounce:              0 kB
    CommitLimit:         0 kB
    Committed_AS:        0 kB
    VmallocTotal:        0 kB
    VmallocUsed:         0 kB
    VmallocChunk:        0 kB
    HugePages_Total:     0
    HugePages_Free:      0
    HugePages_Rsvd:      0
    Hugepagesize:     2048 kB
    
     
    #2 GoWilkes, Feb 1, 2015
    Last edited: Feb 1, 2015
  3. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Another update.

    Am I right in understanding that "named" is using the majority of my RAM? Is this normal?

    Code:
    # ps -e -o pid,vsz,comm= | sort -n -k 2
      PID    VSZ
     1782   4068 courierlogger
     3226   4068 courierlogger
     3235   4068 courierlogger
     3243   4068 courierlogger
     3251   4068 courierlogger
     3227   8280 couriertcpd
     3236   8280 couriertcpd
     3244   8280 couriertcpd
     3252   8280 couriertcpd
     5149   9232 gam_server
     1181  10644 udevd
    22099  11268 ps
     1843  11308 mysqld_safe
    22003  11440 bash
    22047  11440 bash
    21972  17120 imapd
    21974  17132 imapd
     5150  17448 imapd
     1783  19200 authdaemond
     1784  19200 authdaemond
     1785  19200 authdaemond
        1  19232 init
     3313  21348 crond
     3676  22392 atd
     3778  31248 cpanellogd - sl
     3734  35168 cPhulkd - proce
     3757  38976 queueprocd - wa
     3305  39368 pure-authd
    22044  46468 su
     3341  48080 /usr/local/cpan
     5220  49844 /etc/authlib/au
     3844  49848 /etc/authlib/au
    22100  58572 sort
    22505  59852 lfd - sleeping
     1828  66256 sshd
    21986  68816 sshd
    22002  68816 sshd
    16255  69756 exim
    31765  79576 leechprotect
     3772  84932 tailwatchd
     3749 107520 cpdavd - accept
     3303 117244 pure-ftpd
     3740 129156 cpsrvd (SSL) -
    19756 129288 webmaild - serv
    16266 172452 /usr/local/cpan
    16270 191068 spamd child
     3296 219664 httpd
    31771 224304 httpd
    31778 224832 httpd
    31772 225028 httpd
    19716 225160 httpd
    31776 225644 httpd
    31777 225700 httpd
    31770 226228 httpd
    31781 226240 httpd
    31769 226280 httpd
    31780 226284 httpd
    31774 226520 httpd
    31779 226536 httpd
    31775 236012 httpd
    31773 236020 httpd
    31767 236092 httpd
    31768 236108 httpd
     1731 249084 rsyslogd
     7750 330844 memcached
    16275 517076 clamd
     3209 1493148 mysqld
     1745 1924172 named
    
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The following post is a good place to start for understanding memory usage:

    Memory Usage Explained

    Also, have you contacted your hosting provider to verify the memory usage isn't an issue with the VPS hardware node?

    Thank you.
     
  5. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Unfortunately, the server is with GoDaddy, who has ridiculous support:

    Friday:
    Monday:
    - - - Updated - - -

    As of right now, I can't access WHM. This is a new issue as of about an hour ago. I get this error:

    Code:
    Internal Server Error
    
    500
    
    No response from subprocess (whostmgr (whostmgr)): The subprocess exited with status 1 (EPERM).
    
    I tried rebooting, but that didn't help.

    I tried all of the solutions I could find, but nothing helps:

    service cpanel restart

    /scripts/upcp -force

    /usr/local/cpanel/scripts/perlinstaller --force Storable
    (this fails because there's not enough memory)

    I was going to remove ClamAV, since it's using a lot of memory, but can't find a way to do it outside of WHM.

    Any suggestions?
     
  6. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Update. GoDaddy was able to reboot on their end, in a rare showing of support. After the reboot, I was able to get back in to WHM, and remove ClamAV.

    Using top -c, named and mysql are my top processes:

    Code:
    22303 named     25   0 1878m  36m 2668 S  0.0  3.6   0:00.21 /usr/sbin/named -u named
    20029 mysql     15   0 1131m 159m 6224 S  0.0 15.6   0:08.46 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-err
     3523 memcache  18   0  323m  880  524 S  0.0  0.1   0:00.11 memcached -d -p 11211 -u memcached -m 1024 -c 1024 -P /var/run/memcached/memcached.pid -l 127.0.0.1
     3247 root      25   0  243m 1496 1056 S  0.0  0.1   0:00.18 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
    24072 nobody    15   0  218m  15m 5644 S  0.0  1.5   0:00.08 /usr/local/apache/bin/httpd -k start -DSSL
    
    When I stopped MySQL via "service mysql stop", my RAM load immediately recovered:

    Code:
    # free -m
                 total       used       free     shared    buffers     cached
    Mem:          1024        823        200          0          0          0
    -/+ buffers/cache:        823        200
    Swap:            0          0          0
    
    I uninstalled "memcached", and free RAM went up to 249. Stopping httpd brought it up to 441.

    Starting MySQL and httpd back, though (as they're obviously important) took my free RAM back to 0.

    The results from tuning-primer.sh didn't show anything problems, but I was still able to shrink the VIRT of MySQL from 1131m to 676m by going over each value with a fine tooth comb. I can post my my.cnf file if anyone asks, I just didn't want this to be so long it was unreadable.

    I was also able to increase available RAM by adding this to named.conf:

    Code:
    options {
        directory "/var/named";
        max-cache-size 10m;      // maximum cache size of 10MB
        cleaning-interval 15;    // clean cache every 15 minutes
        max-cache-ttl 60;        // limit cached record to a 60s TTL
        max-ncache-ttl 60;       // limit cache neg. resp. to a 60s TTL
    };
    

    Right now, everything seems to be running fine, with the following result from free -m:

    Code:
    # free -m
                 total       used       free     shared    buffers     cached
    Mem:          1024        935         88          0          0          0
    -/+ buffers/cache:        935         88
    Swap:            0          0          0
    
     
  7. bulewold

    bulewold Member

    Joined:
    Jan 29, 2015
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hey, I just got godaddy VPS as well.
    I think you know about these servers more than I do so this might be that helpful but from my experience working with Cpanel hosting with godaddy (even shared)

    Basic system + Cpanel takes up about 1G regularly. I had 2G at shared and I have 2G now with VPS, and at all times, about 1G was always being using for doing about nothing! But that number also never goes beyond 1G... so I kinda came to expect it now.

    From my experience, you might resolve issue by going to 2G package.
     
  8. GoWilkes

    GoWilkes Well-Known Member

    Joined:
    Sep 26, 2006
    Messages:
    367
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    I actually set up this VPS over a year ago, and never even got close to all of the RAM usage. It's deceptive; WHM will show high RAM usage, but when you SSH in and type "free -m" for a real number, you'll see that it's not that much.

    Unfortunately, GoDaddy no longer offers a 2G package. I'm currently paying $40 /month for this VPS, and upgrading to 4G was another $40! At that point, GoDaddy is no longer cost effective; I could get 2G with twice as much storage from Softlayer for $75, and Softlayer has impeccable support.

    You guys might want to consider tweaking your configurations, too. You might be able to save a lot of memory that you didn't know was available, and save some money from an unnecessary upgrade.
     
  9. bulewold

    bulewold Member

    Joined:
    Jan 29, 2015
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Gowilkes, I just got godaddy 2g package for $40/month. Maybe you need to call in and negotiate. Or open a new VPS and migrate. :)
     
Loading...

Share This Page