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.

SOLVED Confused by "Out of memory" alerts

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

  1. tdsm

    tdsm Member

    Joined:
    Mar 18, 2014
    Messages:
    10
    Likes Received:
    2
    Trophy Points:
    3
    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;
    Code:
    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:
    34,401
    Likes Received:
    1,005
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. tdsm

    tdsm Member

    Joined:
    Mar 18, 2014
    Messages:
    10
    Likes Received:
    2
    Trophy Points:
    3
    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:
    34,401
    Likes Received:
    1,005
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    tdsm likes this.
  5. CrazySerb

    CrazySerb Member

    Joined:
    Apr 1, 2015
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    In addition to the original post, I am confused as to why is cPanel sending out hundreds and hundreds of these Out of Memory emails every second once a process hits the ceiling, thus adding more gasoline onto the fire and having all those emails being sent add to the issue, resource usage and clogging up the system?!

    I've had my tech guys look into it and they said it's a bug/issue with cPanel and you should fix it... but I haven't seen anything yet from your end.

    Any idea how to tweak this, or limit those emails to just one per minute (I don't need to know every single time the process gets blocked/terminated, just let me know once a minute or something whether it's still happening or not), in WHM or something?
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,150
    Likes Received:
    262
    Trophy Points:
    83
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You can adjust email notifications here:
    WebHost Manager »Server Contacts »Contact Manager, Notifications tab.

    And you can adjust various system settings here you might like to know about:
    WebHost Manager »Server Configuration »Tweak Settings, System tab.
     
  7. CrazySerb

    CrazySerb Member

    Joined:
    Apr 1, 2015
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    I am aware of that.

    But nowhere in those settings is there an option to limit how many "Out of Memory" notifications I receive per minute or anything close to that.... as those are sent every single time one of the websites causes the PHP or something to hit the ceiling of sorts. And for busy websites that's been happening like 50 times a second, so that my inbox (and Exim on the server) are clogged up in a matter of minutes.
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,150
    Likes Received:
    262
    Trophy Points:
    83
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I think I'd be more inclined to want to know what the issue is and fix it, rather than how I can disable the system alerts about it.
     
  9. CrazySerb

    CrazySerb Member

    Joined:
    Apr 1, 2015
    Messages:
    6
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Well, the tech guys are working on it... but they also noticed that once this happens, these email notices start firing off like crazy, and short of disabling them all together (not an option, as then I have no idea that there's a problem), they add to the problem itself, increasing the server resource usage and such.

    So I'd like to see you guys look into that as well - prevent something like this from pouring more gas onto the fire once the fire breaks out...
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    15,150
    Likes Received:
    262
    Trophy Points:
    83
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Please feel free to open a ticket directly to cPanel Technical Support if needed.
     
Loading...

Share This Page