Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Can't understand "out of memory" kills

Discussion in 'General Discussion' started by Rogerio, Nov 8, 2018.

  1. Rogerio

    Rogerio Well-Known Member

    Joined:
    Sep 26, 2016
    Messages:
    74
    Likes Received:
    13
    Trophy Points:
    8
    Location:
    Sao Paulo, Brazil
    cPanel Access Level:
    Root Administrator
    Hello,

    my server has 4 Gb of RAM and is not overloaded. Sometimes some PHP scripts use more memory and I receive "out of memory" messages, but there is no out of memory... and it kills MySQL, what is a big problem.

    How to fix this?

    ----------

    Out of memory: ⚠ The process “mysqld” was terminated because the system is low on memory.

    In order to avoid a system crash due to low memory, the kernel terminated the process named “mysqld” with the PID “1311”.

    (...)

    Process OOM Score 66
    Status Out of Memory ⚠
    Memory Information
    Used 602 MB
    Available 3.11 GB

    Installed 3.7 GB

    [308508.568672] [12514] 1005 12514 63883 11265 124 566 0 php-cgi
    [308508.572096] [12516] 1005 12516 63883 11018 123 813 0 php-cgi
    [308508.575429] [12517] 1005 12517 63883 11345 123 488 0 php-cgi
    [308508.578967] [12518] 1005 12518 64331 12033 126 302 0 php-cgi
    [308508.582312] [12522] 1005 12522 64014 11704 127 301 0 php-cgi
    [308508.585508] [12533] 1005 12533 57622 5442 109 120 0 php-cgi
    [308508.589325] [12557] 1002 12557 55306 3297 107 13 0 php-cgi
    [308508.594133] [12558] 1002 12558 54101 1978 105 17 0 php-cgi
    [308508.597030] Out of memory: Kill process 1311 (mysqld) score 66 or sacrifice child
    [308508.599799] Killed process 1311 (mysqld) total-vm:1803856kB, anon-rss:206380kB, file-rss:0kB, shmem-rss:0kB
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,224
    Likes Received:
    478
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Rogerio


    So when this happens it's the Linux kernel killing the process to ensure that processes running and those integral to the system which have reserved memory have enough to run. When a process is killed like this and you get the email from cPanel it's not always able to show you what's actually occurring on the server. What might be useful is to check sysstats. The following should give an idea of used memory for the last few hours:

    Code:
    sar -r
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Rogerio likes this.
  3. Rogerio

    Rogerio Well-Known Member

    Joined:
    Sep 26, 2016
    Messages:
    74
    Likes Received:
    13
    Trophy Points:
    8
    Location:
    Sao Paulo, Brazil
    cPanel Access Level:
    Root Administrator
    Hello,
    the CPU was high in that moment, indeed. Well, at least, mysqld was restarted automatically.
    But sometimes it kills other services like snmpd that I need to restart manually.
    Thank you.
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,224
    Likes Received:
    478
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Rogerio


    If you find it's occurring often and it's legitimate usage you might need to look at increasing the amount of memory on the server. This really shouldn't be occurring very frequently.


    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Rogerio likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice