php-fpm: 로그에 수백 초가 기록됩니다.

php-fpm: 로그에 수백 초가 기록됩니다.

nginx+php-fpm 웹 서버가 있습니다

그래서 저는 php5-fpm.log에서 이상한 줄을 많이 발견했습니다:

[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

누구든지 이 초가 어떤 것인지 after 321.722533 seconds from start, 그리고 그것이 무엇을 의미하는지 말해 줄 수 있나요?

UPD

내 구성은 다음과 같습니다

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

답변1

"초"는 시간 단위입니다. 그 중 321명은5분 남짓.

pm.max_requests프로세스가 종료되고 다시 생성되는 이유는 php-fpm 풀 구성 파일에 옵션을 설정했기 때문입니다 .

예를 들어 기본 구성에서 가져왔습니다.

; 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

우리는 볼 수 있습니다당신의으로 설정되어 있으므로 100php-fpm은 100개의 요청을 처리한 후 프로세스를 재활용합니다.

답변2

당신의 설정은 무엇을 max_requests말합니까? 사용량이 많은 웹 사이트인 경우 해당 요청 수에 도달하면 하위 프로세스를 재활용할 가능성이 높습니다. 0으로 표시되지 않는 한, 이 경우 내부 시간 초과가 발생하고 조용한 시간 동안 메모리를 절약하기 위해 하위 프로세스를 닫을 수 있습니다. 나는 IIS용 FastCGI 프로세서가 이 작업을 수행한다는 것을 알고 있습니다. 아마 여기도 같은 상황일 거야.

소스:http://php-fpm.org/wiki/Configuration_File

편집: 그렇다면 그런 일이 일어나고 있습니다. 한 자녀가 요청 100개를 달성하자마자 종료됩니다. 그런 다음 PHP-FPM은 필요할 때(즉시 열릴 수도 있음) 새 항목을 엽니다.

관련 정보