On peak load php-fpm frequently stopped and get 502 error on all sites,

hi,
on peak load php-fpm frequently stopped and get 502 error on all site.

  • bellow error in /var/log/syslog
Jul 25 15:59:21  kernel: [62974.751828] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=containerd.service,mems_allowed=0,global_oom,task_memcg=/system.slice/php8.2-fpm.service,task=php-fpm8.2,pid=124644,uid=1001
Jul 25 15:59:21  kernel: [62974.755693] Out of memory: Killed process 124644 (php-fpm8.2) total-vm:7344184kB, anon-rss:5789400kB, file-rss:0kB, shmem-rss:3764kB, UID:1001 pgtables:14072kB oom_score_adj:0
Jul 25 15:59:21  systemd[1]: php8.2-fpm.service: A process of this unit has been killed by the OOM killer.
Jul 25 15:59:21  systemd[1]: php8.2-fpm.service: Failed with result 'oom-kill'.
Jul 25 15:59:21  systemd[1]: php8.2-fpm.service: Consumed 58min 10.813s CPU time.
Jul 25 15:59:34  systemd[1]: Starting The PHP 8.2 FastCGI Process Manager...
Jul 25 15:59:34  systemd[1]: Started The PHP 8.2 FastCGI Process Manager.
  • /var/log/php8.2-fpm.log is empty

  • my server info : 4v core, 8GB RAM

  • my current pool conf (/etc/php/8.2/fpm/pool.d/domain.conf

pm.max_children = 32
pm.max_requests = 16000

Why php-fpm frequently stopped when increase load on sites?
Thank you,

The Out Of Memory Killer or OOM Killer is a process that the linux kernel employs when the system is critically low on memory . This situation occurs because the linux kernel has over allocated memory to its processes. When a process starts it requests a block of memory from the kernel.

Increase memory …

1 Like

@eris which memory should increase? server total memory or php-fpm?

It is probally max memory if your really need the 32 children and with 16 000 request 8 gb it probally not enough.

1 Like