Nginx dan PHP-FPM sering down


Status
Not open for further replies.

Najamudin

Apprentice 2.0
Verified Provider
pagi tuan2, mudah2an tidak salah kamar
begini tuan, biasanya saya setting nginx dengan beberapa virtualhost dan php-fpm dengan trafik yang sedang tidak masalah, nah baru2 ini saya coba pindah ke penyedia lain

settingan sama2 saja, tapi beda versi, tapi sekarang jadi sering down, dimonitor di nginx amplify dan htop kayakx normal2 aja.
udah dirubah2 di bagian pm.max_children untuk php-fpm nya listen port 127.0.0.1:9000 dari sebelumnya php.sock

bedanya yang sering gangguan pakai soft load balancer aja. apa pengaruh ya
 
php-fpm butuh ram besar mostly
speknya gimana
speknya masih sama sih kaya server yang dulu tuan
1vcpu dan 2gb ram

nah bedanya yang sekarang untuk database sudah beda server, jadi full ke nginx dan php-fpm aja.

di server yang dulu malah digabung dengan spek yang sama masih bisa handle dengan trafik yang sedang.
 
yg mati nginx atau php-fpm? atau malah keduanya
cek log-nya dulu coba
kalau di nginx
2018/08/21 03:56:24 [warn] 13997#13997: *39243 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000100, client: 192.168.0.13, serv$
2018/08/21 03:56:24 [error] 13997#13997: *39243 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: Application\Controller\Admin\suratkeluarsuratkeluar:$
2018/08/21 04:01:01 [warn] 13997#13997: *39344 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000101, client: 192.168.0.13, serv$
2018/08/21 04:04:05 [warn] 13997#13997: *39424 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000102, client: 192.168.0.13, serv$
2018/08/21 04:05:42 [warn] 13997#13997: *39467 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000103, client: 172.69.134.129,

kalau di php fpm
[17-Aug-2018 14:13:15] NOTICE: Terminating ...
[17-Aug-2018 14:13:15] NOTICE: exiting, bye-bye!
[17-Aug-2018 14:13:15] NOTICE: fpm is running, pid 4720
[17-Aug-2018 14:13:15] NOTICE: ready to handle connections
[17-Aug-2018 14:13:15] NOTICE: systemd monitor interval set to 10000ms
[17-Aug-2018 15:45:53] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 1 idle, a$
[17-Aug-2018 15:45:54] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 1 idle, $
[18-Aug-2018 01:43:55] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 1 idle, a$
[18-Aug-2018 01:43:56] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 1 idle, $
[19-Aug-2018 00:42:31] WARNING: [pool www] server reached pm.max_children setting (50), consider raising it
[19-Aug-2018 03:36:15] NOTICE: Terminating ...
[19-Aug-2018 03:36:15] NOTICE: exiting, bye-bye!
[19-Aug-2018 03:36:15] NOTICE: fpm is running, pid 30251
[19-Aug-2018 03:36:15] NOTICE: ready to handle connections
[19-Aug-2018 03:36:15] NOTICE: systemd monitor interval set to 10000ms

namun pas saya cek statusnya online kok tuan
 
coba dinakking config phpfpm pm.start_servers pm.min/max_spare_servers sesuai lognya
 
coba dinakking config phpfpm pm.start_servers pm.min/max_spare_servers sesuai lognya
siap tuan, saya coba naikkan sbb :
pm.max_children : 20
pm.start_server : 3
pm.min_spare_server : 3
pm.max_spare_server : 5
pm.max_requests = 1000

apa benar tuan. ini masih saya coba tuan, belum tau effeknya
 
[17-Aug-2018 15:45:53] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 1 idle, a$
[17-Aug-2018 15:45:54] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 1 idle, $
[18-Aug-2018 01:43:55] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 1 idle, a$
[18-Aug-2018 01:43:56] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 1 idle, $

sepertinya ini penyebab php-fpm jadi intermittent
coba disesuaikan dulu aja

kalo dulu ada tools php-fpmpal untuk advice setting max_children, lumayan valid hasilnya
cara kerjanya mirip apache2buddy atau mysqltuner
tapi sepertinya udah ga diupdate lagi
 
sepertinya ini penyebab php-fpm jadi intermittent
coba disesuaikan dulu aja

kalo dulu ada tools php-fpmpal untuk advice setting max_children, lumayan valid hasilnya
cara kerjanya mirip apache2buddy atau mysqltuner
tapi sepertinya udah ga diupdate lagi
wah terimakasih tuan infonya, baru tau ada.. coba cek tkp dulu
 
Status
Not open for further replies.
Back
Top