Ryan_G

Member
Nov 2, 2017
6
0
1
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
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.
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.
 

jasoncollege24

Active Member
Mar 25, 2012
29
3
53
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
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.
 

jasoncollege24

Active Member
Mar 25, 2012
29
3
53
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
 
  • Like
Reactions: cPanelMichael