php-fpm virtual memory

I always get this triggered report comes to my email many times a day.
Account: bizzindex
Resource: Virtual Memory Size
Exceeded: 520 > 512 (MB)
Executable: /opt/cpanel/ea-php74/root/usr/sbin/php-fpm
Command Line: php-fpm: pool bizzindex_com
PID: 20055 (Parent PID:1504)
Killed: No

I adjusted the memory size in WHM to 2048 and php.ini to 1024mb but, it did not seem to help.

What is the best solution? Thanks

2 Replies

Linode Staff

Hello! There can be multiple places to change the PHP memory limit, and PHP-FPM has it's own configuration file, usually at /etc/phpX/fpm/php-fpm.conf where "phpX" is your version of PHP. There's a Stack Overflow post with further suggestions here:

https://stackoverflow.com/questions/15962634/nginx-or-php-fpm-ignores-memory-limit-in-php-ini

@mjones writes:

Hello! There can be multiple places to change the PHP memory limit, and PHP-FPM has it's own configuration file, usually at /etc/phpX/fpm/php-fpm.conf where "phpX" is your version of PHP. There's a Stack Overflow post with further suggestions here:
 
https://stackoverflow.com/questions/15962634/nginx-or-php-fpm-ignores-memory-limit-in-php-ini

Since the OP mentions php 7.4:

Executable: /opt/cpanel/ea-php74/root/usr/sbin/php-fpm

On Debian/Ubuntu, since the advent of PHP 7 or so, php.ini has been centralized in a single place /etc/php:

  • /etc/php/<version>/cli/php.ini
  • /etc/php/<version>/apache2/php.ini
  • /etc/php/<version>/fpm/php.ini

where <version> is the PHP version number and {cli, apache2, fpm} are the operational php.ini's for the command-line, the apache2 plug-in and the fastcgi process manager, respectively.

PHP comes with two native functions to show which config file is loaded:

You can try each one of these out with something like:

php -r 'echo php_ini_loaded_file();'

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct