Upgrade EasyApache 4 - Out of memory 500 errors

sighthosting

Registered
Jul 24, 2016
2
0
1
London
cPanel Access Level
Website Owner
Everything was working perfectly on EasyApache 3, I received some notifications from app developers that everyone is moving towards PHP 7 so I decided to upgraded to EA4 on my vps and since then just about every application is running out of memory specially wordpress, whmcs are the ones battling the most.

I am not a wizard at what the optimal memory, but my servers memory usage doesn't seem right all of a sudden.

Can someone please advise me what I should do.

I ran [[email protected] ~]# free -h

total used free shared buff/cache available

Mem: 3.7G 630M 299M 43M 2.8G 2.8G

Swap: 1.0G 11M 1.0G
 

sighthosting

Registered
Jul 24, 2016
2
0
1
London
cPanel Access Level
Website Owner
if anyone else has the same issue go to 'Multiphp manager' in Whm and ensure you have the write php version assigned to a domain. then you go to 'MultiPHP INI Editor' and you change the memory limit in there. Just for safety sake I restarted apache too! good luck
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Everything was working perfectly on EasyApache 3, I received some notifications from app developers that everyone is moving towards PHP 7 so I decided to upgraded to EA4 on my vps and since then just about every application is running out of memory specially wordpress, whmcs are the ones battling the most.
Hello,

Did you notice the increased memory usage after switching to PHP 7, or is this just with EasyApache 4 alone, without switching to PHP 7?

Thank you.
 

nightaddix

Active Member
PartnerNOC
Jul 7, 2008
30
0
56
I'm seeing this as well after upgrading to EasyApache4. I'm seeing this both from websites running PHP 5.6.24 and from websites running PHP 7. I have CSF installed on my server and it seems that after the upgrade to EasyApache4 (which was done right after I upgraded to cPanel 11.58.0.12), I get notifications from LFD saying that scripts were using more than 300M. As I only have a handfull of websites and 8G of RAM, I bumped the limit to 400 but I'm still getting messages:

Time: Thu Aug 4 20:19:35 2016 +0100
Account: xxx
Resource: Virtual Memory Size
Exceeded: 461 > 400 (MB)
Executable: /opt/cpanel/ea-php70/root/usr/bin/php-cgi
Command Line: /opt/cpanel/ea-php70/root/usr/bin/php-cgi /home/xxx/public_html/xxx.com/owncloud/remote.php
PID: 28025 (Parent PID:26792)
Killed: No

I'm running CentOS Linux release 7.2.1511 (Core) w/ kernel 3.10.0-327.10.1.el7.x86_64 and have cPanel set to use the RELEASE (recommended) version. Apache version is Apache/2.4.23 (cPanel). Please let me know if I can provide any further information. Thank you.
 

linux4me2

Well-Known Member
Aug 21, 2015
259
80
78
USA
cPanel Access Level
Root Administrator
Hello :),

You need to increase your memory limit which you have setup in php.ini file. Please check your php configuration and increase it.
I had a problem with this as well after upgrading to EasyApache4. For some reason, the memory_limit for each installed PHP version was only 30M in EasyApache4, whereas it was 64M in EasyApache3. What fixed it for me was changing the memory_limit for each installed PHP version as 24x7server recommended by going Software -> MultiPHP INI Editor and adjusting the memory_limit to the 128M PHP default value, then clicking "Apply." I'm running Litespeed, but I didn't have to restart it for the change to take effect.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
I have CSF installed on my server and it seems that after the upgrade to EasyApache4 (which was done right after I upgraded to cPanel 11.58.0.12), I get notifications from LFD saying that scripts were using more than 300M. As I only have a handfull of websites and 8G of RAM, I bumped the limit to 400 but I'm still getting messages:

Time: Thu Aug 4 20:19:35 2016 +0100
Account: xxx
Resource: Virtual Memory Size
Exceeded: 461 > 400 (MB)
Executable: /opt/cpanel/ea-php70/root/usr/bin/php-cgi
Could you let us know which limit you increased? Ensure you review the following document if you are adjusting the PHP memory limit:

cPanel's PHPRC PHP Patch for EasyApache 4 - EasyApache 4 - cPanel Documentation

Thank you.
 

nightaddix

Active Member
PartnerNOC
Jul 7, 2008
30
0
56
Hi,

Apologies for the confusion, I increased the LFD alert limit because I got bored of the alerts. Just got another one:

Time: Fri Aug 12 19:45:34 2016 +0100
Account: xxx
Resource: Virtual Memory Size
Exceeded: 437 > 400 (MB)
Executable: /opt/cpanel/ea-php56/root/usr/bin/php-cgi
Command Line: /opt/cpanel/ea-php56/root/usr/bin/php-cgi /home/xxx/public_html/wp-admin/admin-ajax.php
PID: 26725 (Parent PID:19434)
Killed: No


I know it's virtual memory, but still, this only started happening after the migration to EasyApache4. I'd be more than happy to post any configs needed for further investigation.
 

MikeTheWebGuy

Registered
Aug 17, 2016
1
0
1
USA
cPanel Access Level
Root Administrator
Since upgrading to 58 I've been getting a lot of emails like this...

Code:
Resource:     Virtual Memory Size
Exceeded:     310 > 200 (MB)
Executable:   /opt/cpanel/ea-php70/root/usr/bin/php-cgi
Command Line: /opt/cpanel/ea-php70/root/usr/bin/php-cgi /home/clientname/public_html/index.php
PID:          15161 (Parent PID:15003)
Killed:       No
This email is showing up from every account that has PHP, not just a single script.
MultiPHP shows the handler is SuPHP but this looks like it's set for CGI to me. When I look inside that directory (/opt/cpanel/ea-php70/root/usr/bin/), shouldn't I see something like php-suphp?

TL;DR: How do I put an end to exclusively using resources?

Longer question as I'm learning and want to know what's going on: What's going on? What am I not doing properly?




Code:
/etc/redhat-release:CentOS release 6.8 (Final)
/usr/local/cpanel/version:11.58.0.20
/var/cpanel/envtype:kvm
CPANEL=release
Server version: Apache/2.4.23 (cPanel)
Server built:   Jul 20 2016 18:30:57
PHP 7.0.9 (cli) (built: Jul 25 2016 15:10:26) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
mysql  Ver 14.14 Distrib 5.6.31, for Linux (x86_64) using  EditLine wrapper
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
I know it's virtual memory, but still, this only started happening after the migration to EasyApache4. I'd be more than happy to post any configs needed for further investigation.
Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

kenwmitchell

Registered
Jun 8, 2016
1
0
1
United States
cPanel Access Level
Root Administrator
Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

Thank you.
How did this turn out? I upgraded a server to EA4 tonight and immediately started getting VM usage 3x higher than my previous average. Also, I noticed that the binary is now
/opt/cpanel/ea-php70/root/usr/bin/php-cgi instead of /usr/bin/php, but that might be expected.

Code:
# /usr/local/cpanel/bin/rebuild_phpconf --current
DEFAULT PHP: ea-php56
ea-php54 SAPI: suphp
ea-php55 SAPI: suphp
ea-php56 SAPI: suphp
Thanks in advance!
 

dorac

Member
Jun 7, 2013
22
4
3
South Africa
cPanel Access Level
Root Administrator
I'm having exactly the same problem. After upgrading, all (a lot of) sites seem to fail if using more than 50mb.

[19-Sep-2016 14:16:42 UTC] PHP Fatal error: Out of memory (allocated 50069504) (tried to allocate 12288 bytes) in /home/spider/public_html/wp-admin/includes/class-wp-upgrader.php on line 212

Wordpress and Prestashop so far seem to be affected.

I have PHP 5.4, 5.5, 5.6, and 5.7. All of which have been modified accordingly via the php manager and ini files. I set the memory limit to 128M, and even phpinfo() confirms this - the apps still run out of memory.

Anyone have any clue?
 

aolbrechts

Active Member
Feb 24, 2016
26
1
3
Belgium
cPanel Access Level
Root Administrator
Same thing here, just upgraded to EasyApache 4 ans I keep on receiving those alerts for virtual memory usage.
Seems to have doubled since EA3

What config should be changed to optimise this memory usage ?

Thanks,
Antoine
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463