NC 18 - Out of Memory: Kill process (php)

Moin, ich habe den oben beschriebenen Fehler.
Out of Memory: Kill process (php) score 383 or sacrified child …
Den Fehler habe ich bei 3GB RAM und bei 6 GB RAM im System unter Debian 10 mit PHP 7.3
Es spielt keine Rolle ob ich viele Dateien in der NC habe oder fast gar keine.
Jemand eine Idee ?

Die Frage ist, wie viel Speicher Du für PHP reserviert hast (memory_limit = ???).

memory_limit = 512M

Have you checked that this value is set for both, the cli and the web interface?

Steht so in der php.ini
Wo muss ich das noch einstellen ?
in de cli/php.ini steht
memory_limit = -1

Nur weil es so in einer Datei steht heißt es nicht, dass es für beide Komponenten gilt.

CLI: # php -i | grep memory_limit

WEB: info.php erstellen mit folgendem Inhalt und dann über einen Webbrowser öffen:

<?php phpinfo() ?>

Meine Empfehlung lautet auch hier einen festen Wert von z.B. 512M zu setzen. Siehe

Ich habe es geändert.
Ich hatte ein PHP Optimierungsscript aus dem Internet angewendet.
Ich hatte auf php-fpm umgestellt und dann optimiert.

sed -i “s/;env[HOSTNAME] = /env[HOSTNAME] = /” /etc/php/7.3/fpm/pool.d/www.conf
sed -i “s/;env[TMP] = /env[TMP] = /” /etc/php/7.3/fpm/pool.d/www.conf
sed -i “s/;env[TMPDIR] = /env[TMPDIR] = /” /etc/php/7.3/fpm/pool.d/www.conf
sed -i “s/;env[TEMP] = /env[TEMP] = /” /etc/php/7.3/fpm/pool.d/www.conf
sed -i “s/;env[PATH] = /env[PATH] = /” /etc/php/7.3/fpm/pool.d/www.conf
sed -i “s/pm.max_children = ./pm.max_children = 240/" /etc/php/7.3/fpm/pool.d/www.conf
sed -i "s/pm.start_servers = .
/pm.start_servers = 20/” /etc/php/7.3/fpm/pool.d/www.conf
sed -i “s/pm.min_spare_servers = ./pm.min_spare_servers = 10/" /etc/php/7.3/fpm/pool.d/www.conf
sed -i "s/pm.max_spare_servers = .
/pm.max_spare_servers = 20/” /etc/php/7.3/fpm/pool.d/www.conf
sed -i “s/;pm.max_requests = 500/pm.max_requests = 500/” /etc/php/7.3/fpm/pool.d/www.conf
sed -i “s/output_buffering =./output_buffering = ‘Off’/" /etc/php/7.3/cli/php.ini
sed -i "s/max_execution_time =.
/max_execution_time = 1800/” /etc/php/7.3/cli/php.ini
sed -i “s/max_input_time =./max_input_time = 3600/" /etc/php/7.3/cli/php.ini
sed -i "s/post_max_size =.
/post_max_size = 10240M/” /etc/php/7.3/cli/php.ini
sed -i “s/upload_max_filesize =./upload_max_filesize = 10240M/" /etc/php/7.3/cli/php.ini
sed -i "s/max_file_uploads =.
/max_file_uploads = 100/” /etc/php/7.3/cli/php.ini
sed -i “s/;date.timezone./date.timezone = Europe/\Berlin/" /etc/php/7.3/cli/php.ini
sed -i "s/;session.cookie_secure.
/session.cookie_secure = True/” /etc/php/7.3/cli/php.ini
sed -i “s/memory_limit = 128M/memory_limit = 512M/” /etc/php/7.3/fpm/php.ini
sed -i “s/output_buffering =./output_buffering = ‘Off’/" /etc/php/7.3/fpm/php.ini
sed -i "s/max_execution_time =.
/max_execution_time = 1800/” /etc/php/7.3/fpm/php.ini
sed -i “s/max_input_time =./max_input_time = 3600/" /etc/php/7.3/fpm/php.ini
sed -i "s/post_max_size =.
/post_max_size = 10240M/” /etc/php/7.3/fpm/php.ini
sed -i “s/upload_max_filesize =./upload_max_filesize = 10240M/" /etc/php/7.3/fpm/php.ini
sed -i "s/max_file_uploads =.
/max_file_uploads = 100/” /etc/php/7.3/fpm/php.ini
sed -i “s/;date.timezone./date.timezone = Europe/\Berlin/" /etc/php/7.3/fpm/php.ini
sed -i "s/;session.cookie_secure.
/session.cookie_secure = True/” /etc/php/7.3/fpm/php.ini
sed -i “s/;opcache.enable=./opcache.enable=1/" /etc/php/7.3/fpm/php.ini
sed -i "s/;opcache.enable_cli=.
/opcache.enable_cli=1/” /etc/php/7.3/fpm/php.ini
sed -i “s/;opcache.memory_consumption=./opcache.memory_consumption=128/" /etc/php/7.3/fpm/php.ini
sed -i "s/;opcache.interned_strings_buffer=.
/opcache.interned_strings_buffer=8/” /etc/php/7.3/fpm/php.ini
sed -i “s/;opcache.max_accelerated_files=./opcache.max_accelerated_files=10000/" /etc/php/7.3/fpm/php.ini
sed -i "s/;opcache.revalidate_freq=.
/opcache.revalidate_freq=1/” /etc/php/7.3/fpm/php.ini
sed -i “s/;opcache.save_comments=./opcache.save_comments=1/" /etc/php/7.3/fpm/php.ini
sed -i ‘$aapc.enable_cli=1’ /etc/php/7.3/mods-available/apcu.ini
sed -i "s/;emergency_restart_threshold =.
/emergency_restart_threshold = 10/” /etc/php/7.3/fpm/php-fpm.conf
sed -i “s/;emergency_restart_interval =./emergency_restart_interval = 1m/" /etc/php/7.3/fpm/php-fpm.conf
sed -i "s/;process_control_timeout =.
/process_control_timeout = 10s/” /etc/php/7.3/fpm/php-fpm.conf

Ich teste es.
1000 Dank schon mal soweit.