php-fpm: ratusan detik di log

12

Saya memiliki server web nginx + php-fpm

Jadi saya perhatikan di php5-fpm.log banyak baris aneh:

[03-Sep-2013 09:25:23] NOTICE: [pool www] child 23999 exited with code 0 after 321.832329 seconds from start
[03-Sep-2013 09:25:23] NOTICE: [pool www] child 24082 started
[03-Sep-2013 09:25:41] NOTICE: [pool www] child 24032 exited with code 0 after 259.247887 seconds from start
[03-Sep-2013 09:25:41] NOTICE: [pool www] child 24083 started
[03-Sep-2013 09:25:47] NOTICE: [pool www] child 24033 exited with code 0 after 255.954602 seconds from start
[03-Sep-2013 09:25:47] NOTICE: [pool www] child 24084 started
[03-Sep-2013 09:25:50] NOTICE: [pool www] child 24014 exited with code 0 after 327.620462 seconds from start
[03-Sep-2013 09:25:50] NOTICE: [pool www] child 24085 started
[03-Sep-2013 09:25:55] NOTICE: [pool www] child 24034 exited with code 0 after 254.974653 seconds from start
[03-Sep-2013 09:25:55] NOTICE: [pool www] child 24086 started
[03-Sep-2013 09:26:01] NOTICE: [pool www] child 24035 exited with code 0 after 253.388234 seconds from start
[03-Sep-2013 09:26:01] NOTICE: [pool www] child 24087 started
[03-Sep-2013 09:26:02] NOTICE: [pool www] child 24036 exited with code 0 after 251.374430 seconds from start
[03-Sep-2013 09:26:02] NOTICE: [pool www] child 24088 started
[03-Sep-2013 09:26:05] NOTICE: [pool www] child 24019 exited with code 0 after 325.601766 seconds from start
[03-Sep-2013 09:26:05] NOTICE: [pool www] child 24089 started
[03-Sep-2013 09:26:09] NOTICE: [pool www] child 24037 exited with code 0 after 255.871955 seconds from start
[03-Sep-2013 09:26:09] NOTICE: [pool www] child 24090 started
[03-Sep-2013 09:26:09] NOTICE: [pool www] child 24038 exited with code 0 after 255.884311 seconds from start
[03-Sep-2013 09:26:09] NOTICE: [pool www] child 24091 started
[03-Sep-2013 09:26:09] NOTICE: [pool www] child 24039 exited with code 0 after 254.826181 seconds from start
[03-Sep-2013 09:26:09] NOTICE: [pool www] child 24092 started
[03-Sep-2013 09:26:12] NOTICE: [pool www] child 24040 exited with code 0 after 256.232759 seconds from start
[03-Sep-2013 09:26:12] NOTICE: [pool www] child 24093 started
[03-Sep-2013 09:26:14] NOTICE: [pool www] child 24027 exited with code 0 after 321.722533 seconds from start

Adakah yang bisa memberi tahu saya, seperti apa detik-detik ini after 321.722533 seconds from startdan apa artinya?

UPD

Konfigurasi saya adalah:

pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 100
Lari13
sumber

Jawaban:

20

"Detik" adalah satuan waktu; 321 dari mereka adalah sedikit lebih dari lima menit .

Alasan proses Anda keluar dan respawning adalah bahwa Anda telah menetapkan pm.max_requestsopsi di file konfigurasi pool php-fpm Anda.

Misalnya, diambil dari konfigurasi default:

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 500

Kami dapat melihat dalam konfigurasi Anda bahwa itu diatur 100, sehingga php-fpm mendaur ulang proses setelah memproses 100 permintaan.

Michael Hampton
sumber
Jadi, itu hanya berarti bahwa utas beton tinggal beberapa 321detik dan akan dihidupkan kembali. Saya tidak bisa memperhatikannya?
Lari13
1
Anda dapat mengabaikan pesan-pesan ini; mereka tidak berbahaya dan murni informasi.
Michael Hampton
Entri log ini dapat dihindari dengan menaikkan log_levelparameter php-fpm.confdari notice(yang mungkin merupakan nilai default) kewarning
Paolo
2

Apa yang dikatakan max_requestspengaturan Anda ? Jika ini adalah situs web yang sibuk, kemungkinan akan mendaur ulang proses anak-nya setelah mencapai jumlah permintaan itu - kecuali jika dikatakan 0, dalam hal ini bisa mengenai batas waktu internal dan menutup proses anak untuk menghemat memori selama waktu tenang. Saya tahu prosesor FastCGI untuk IIS melakukan ini; kemungkinan situasinya sama di sini.

Src: http://php-fpm.org/wiki/Configuration_File

EDIT: Lalu itulah yang terjadi. Begitu satu anak mencapai 100 permintaan, itu akan ditutup. PHP-FPM kemudian akan membuka yang baru ketika dibutuhkan (yang bisa segera).

Aaron Mason
sumber
pm.max_requests = 100dalam konfigurasi saya. Silakan, lihat pembaruan
Lari13