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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

excessive resource usage with script

Discussion in 'General Discussion' started by Ryan_G, Nov 2, 2017.

  1. Ryan_G

    Ryan_G Registered

    Joined:
    Nov 2, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I am getting excessive resource usage warnings for Virtual Memory for some scripts that run with cron. The warnings tend to come through in groups several times a day - I'll get no warnings most of the day then one script will generate a warning every time it runs for 20 minutes or so. Here are the pertinent parts of one of the email warnings:

    Resource: Virtual Memory Size
    Exceeded: 332 > 300 (MB)
    Executable: /path/to/php-cgi
    Command Line: /path/to/my-script.php

    So my question is: since the executable is php-cgi does this mean that the memory is being used by PHP (as opposed to MySQL or cron or something else). If I can narrow this down to definitely being PHP I can start looking through the scripts for potential memory leaks with some confidence that I'm using my time effectively.

    Apologies for another post on excessive resource usage but I have spent many days trying to fix this issue and read many related posts here and on Stack Overflow and struggling to find a solution.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    41,494
    Likes Received:
    1,612
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, it would relate to the specific PHP script referenced under the "Command Line" section of that notification. Keep in mind this notification stems from CSF/LFD as opposed to cPanel, so you'd need to check with their support team if it's not correctly reporting data.

    Thank you.
     
  3. Ryan_G

    Ryan_G Registered

    Joined:
    Nov 2, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Good to know - thanks for the information.
     
  4. jasoncollege24

    Joined:
    Mar 25, 2012
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    53
    Location:
    Portsmouth, Virginia, United States
    cPanel Access Level:
    Root Administrator
    I'm having the same problem, but the command line is not the same.

    Resource: Virtual Memory Size
    Exceeded: 434 > 360 (MB)
    Executable: /opt/cpanel/ea-php70/root/user/bin/php-cgi
    Command Line: /opt/cpanel/ea-php70/root/user/bin/php-cgi

    I've increased the allotted Virtual memory size in lfd 3 times now, and no matter how much i increase it, this still happens. My server only has 500MB of virtual memory, and if this keeps up, i'm going to go over that very quickly.
    Today, I switched the one site i had using PHP7.0 to 5.6. This will let me find out if it's the site, or some issue with PHP 7. If this is a problem with PHP 7, would there be a way to resolve it, without uninstalling?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    41,494
    Likes Received:
    1,612
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @jasoncollege24,

    It's unlikely to relate to the version of PHP utilized on the system. What PHP handler and MPM option is enabled on the server? Is the website using a specific script (e.g. WordPress)?

    Thank you.
     
  6. jasoncollege24

    Joined:
    Mar 25, 2012
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    53
    Location:
    Portsmouth, Virginia, United States
    cPanel Access Level:
    Root Administrator
    The subdomain in question was using mod_mpm_prefork for the MPM
    Home > Software > MultiPHP Manager says that cgi is the PHP handler for PHP 7

    I believe this was caused by using OwnCloud on a server with low memory, and have removed the owncloud software as a test, but thank you!

    Your question has possibly sent me in the right direction to resolve another minor issue I've had for a while, that may be resolved by changing PHP handlers
     
    cPanelMichael likes this.
Loading...

Share This Page