Link to home
Start Free TrialLog in
Avatar of Chris Kenward
Chris KenwardFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I stop Virtual Memory Errors on VPS

I am continually getting this error from one of our VPS servers

Time:         Wed Apr  3 08:55:22 2019 +0100
Account:      accountname
Resource:     Virtual Memory Size
Exceeded:     561 > 512 (MB)
Executable:   /opt/cpanel/ea-php70/root/usr/bin/php-cgi
Command Line: /opt/cpanel/ea-php70/root/usr/bin/php-cgi
PID:          12755 (Parent PID:2746)
Killed:       No

Eventually the server hangs and I have to reset it to get it going again. This is obviously caused by something I have not set up correctly and I'm hoping that someone can help me set it right. Many thanks in anticipation.

Chris
Avatar of Bernie Bsen
Bernie Bsen
Flag of Germany image

This question is answered here
Avatar of Chris Kenward

ASKER

Hi - thanks for getting back to me.

I looked at the post you pointed me at. All I get from that is to increase the PT_USERMEM to stop the notifications. However, how is this going to stop the server from eventually hanging and requiring a reset?

Cheers
Chris
add the entry "memory_limit = 2048M" to your php.ini
that should work.
Hi there - I have done this. Will wait to see if it works. Many thanks.
Hi there - I got this one a little while ago...

Time:         Wed Apr  3 16:53:34 2019 +0100
Account:      accountname
Resource:     Virtual Memory Size
Exceeded:     588 > 512 (MB)
Executable:   /opt/cpanel/ea-php70/root/usr/sbin/php-fpm
Command Line: php-fpm: pool domain_co_uk                        
PID:          4392 (Parent PID:23045)
Killed:       No
Avatar of noci
noci

cgi & fpm use different .ini files.
So you need to update the ini file for PHP-FPM now.
Are you sure your ini file is the one that's currently in use?
You find the location of the ini file by opening a shell and entering

php -i | grep "Loaded Configuration File"

Open in new window

Hi there brb6708

This is what I get:

/opt/cpanel/ea-php70/root/etc/php.ini

It's the only version of php on the server.

I have edited the files with the values we discussed.

Cheers
Chris
@noci

What values will I need to put in there for php v 7.0 ?

Thanks
Chris
Memory limit is one: http://php.net/memory-limit

Now fpm also has some other controls..
that control the fpm service process:
And maybe you can set some rsource limts there
Also there the memory_limit can be set:    php_admin_value[memory_limit]

If you cannot control this fpm.conf  - conffile then
you may need to contact your hosting provider.
ASKER CERTIFIED SOLUTION
Avatar of Chris Kenward
Chris Kenward
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial