Jump to content

php-fpm


Rashp
 Share

Recommended Posts

подскажите пожалуйста лог php-fpm козлит 

server reached pm.max_children setting (80), consider raising it

seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children are 0 idle, and 79 total children

На серванте 8 CPU, 16 Gb памяти 

ps -ylC php-fpm --sort:rss -u www-data

S   UID   PID  PPID  C PRI  NI   RSS    SZ WCHAN  TTY          TIME CMD

S    33   638   637  0  80   0 12228 11324 do_epo ?        00:00:00 nginx

S    33   649   637  0  80   0 13544 11453 do_epo ?        00:00:00 nginx

S    33   650   637  0  80   0 14000 11510 do_epo ?        00:00:00 nginx

S    33   639   637  0  80   0 15120 11817 do_epo ?        00:00:01 nginx

S    33   641   637  0  80   0 15716 11918 do_epo ?        00:00:01 nginx

S    33   646   637  0  80   0 16816 11761 do_epo ?        00:00:02 nginx

S    33   644   637  0  80   0 16916 12211 do_epo ?        00:00:01 nginx

S    33   640   637  0  80   0 20980 12577 do_epo ?        00:01:39 nginx

текущие настройки:

pm = dynamic

pm.max_children = 80

pm.start_servers = 6

pm.min_spare_servers = 4

pm.max_spare_servers = 8

pm.max_requests = 500

 

Или поставить?

pm = dynamic
pm.max_children = 40
pm.start_servers = 8
pm.min_spare_servers = 4
pm.max_spare_servers = 12
pm.max_requests = 500

Link to comment
Share on other sites

Он Вам пишет, что сервер достигает лимита в 80 чилдранов.

Надо увеличивать, а не уменьшать. С Вашим объемом памяти, можно поставить 200, но надо посмотреть не привышают ли они допустимую память в таком случае. Тут надо выяснить сколько потребляет памяти каждый процесс.

Я бы вот так сделал

pm = dynamic
pm.max_children = 200
pm.start_servers = 16
pm.min_spare_servers = 8
pm.max_spare_servers = 16
pm.max_requests = 500

Ну и кеширование бы тоже помогло бы.

Edited by chixx
Link to comment
Share on other sites

В 12.02.2025 в 23:02, Rashp сказал:

от 10 до 20 мб на процесс получается, процессов 8 

 

Ну значит норм, как я написал. Только pm.max_requests = 500 нужно будет уменьшать, если будет утекать память.

А если чилдранов хватать не будет, в Вашем случае можно в принципе до 400 их поднимать.

Edited by chixx
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...