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.

Confused by "Out of memory" alerts

Discussion in 'Workarounds and Optimization' started by tdsm, Apr 13, 2016.

  1. tdsm

    tdsm Registered

    Joined:
    Mar 18, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi cPanel gurus,

    I've been getting a lot of 'out of memory' email alerts for the past few weeks. I actually had many more a couple of months ago before upgrading my RAM but they still persist.

    The error always either refers to the PHP process or MySQL.

    Looking at the alerts, the memory information section always confuses me as the amount of used memory is always far less than the total so why should the process fail? The process that uses the most memory in all instances is owned by mysql and uses up around 8% of memory.

    Here's an example message, if anyone can give me a good starting point it would be really appreciated;

    Process Total Virtual Memory: 252292kB
    Process Anonymous Resident Set Size: 17600kB
    Process File Resident Set Size: 424kB
    Process OOM Score: 9
    Status: Out of Memory ⚠

    Memory Information
    Used: 656 MB
    Available: 1.19 GB
    Installed: 1.83 GB

    Load Information
    97.29 45.97 17.92

    Uptime
    61 days, 40 minutes, and 34 seconds

    IOStat Information
    avg-cpu: %user %nice %system %iowait %steal %idle
    9.26 0.21 1.67 0.16 0.56 88.14
    Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
    vda 16.23 502.18 156.53 2650533428 826197422

    Top Processes

    PID | Owner | CPU % | Memory % | Command
    3983 | mysql | 2.11 | 8.31
    /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/vps38353165.123-vps.co.uk.err --open-files-limit=65535 --pid-file=/var/lib/mysql/vps38353165.123-vps.co.uk.pid

    4303 | root | 7.44 | 1.44
    tailwatchd - chkservd - sending OOM notification

    4309 | root | 7.08 | 1.44
    tailwatchd - chkservd - sending OOM notification

    4313 | root | 6.93 | 1.44
    tailwatchd - chkservd - sending OOM notification

    4311 | root | 6.73 | 1.44
    tailwatchd - chkservd - sending OOM notification
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,761
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. tdsm

    tdsm Registered

    Joined:
    Mar 18, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks so much cPanelMichael and sorry for the slow response

    I will definitely have a good look over this tutorial when I have more time.

    I wonder if you could help me on more time...

    I'm on a VPS and my RAM is quite low, all sites on the VPS are Wordpress installs. I've looking into MPM Prefork/ITK to see if I can limit memory usage as this is what keeps throwing up problems.

    I have found some very conflicting advice! It seems to indicate that Prefork spawns a new PHP process per request and that ITK is kinder on memory. I'm sure I also read somewhere that you can limit the number of PHP processes through WHM if you use ITK... is this true as it might help me guard against spawning of loads of processes?

    Easy Apache gives me 4 recommended profiles;

    Basic Apache 2.2 (MPM Prefork)
    Basic Apache 2.4 (MPM Prefork)
    MPM ITK
    Mod Ruid2

    Which would be most suitable in this case?

    Tom
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,761
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    tdsm likes this.
Loading...

Share This Page