MaxClients 설정에 도달 한 후 아파치 서비스 중지


11

아파치 서버를 작업자 MPM으로 다음과 같이 구성했습니다.

<IfModule mpm_worker_module>
    ServerLimit         20
    ThreadLimit         50
    StartServers        3
    MaxClients          1000
    MinSpareThreads     50
    MaxSpareThreads     200
    ThreadsPerChild     50
    MaxRequestsPerChild 10000
</IfModule>

서버는 매일 약 2 백만 건의 요청을받습니다. 요청이 나오면 아파치 서버는 새로운 연결을 수락하지 않습니다 (브라우저는 연결할 수 없습니다). 프로세스는 프로세스 목록에 남아 있습니다. 메모리 사용량은 약 10 %이고 CPU는 0 %입니다. 아파치 서버가 필요할 때 프로세스를 재활용하지 못한 것 같습니다.

오류 로그에서 충돌과 관련된 것을 발견했습니다.

[Mon Aug 15 12:36:24 2011] [error] child process 11444 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 12090 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 10698 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 12144 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 12032 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:24 2011] [error] child process 10699 still did not exit, sending a SIGKILL
[Mon Aug 15 12:36:25 2011] [notice] caught SIGTERM, shutting down
[Mon Aug 15 12:37:31 2011] [notice] mod_python: Creating 8 session mutexes based on 20 max processes and 50 max threads.
[Mon Aug 15 12:37:31 2011] [notice] mod_python: using mutex_directory /tmp 
[Mon Aug 15 12:37:31 2011] [notice] Apache/2.2.17 (Ubuntu) mod_python/3.3.1 Python/2.7.1+ mod_ssl/2.2.17 OpenSSL/0.9.8o configured -- resuming normal operations
[Mon Aug 15 15:36:46 2011] [error] server is within MinSpareThreads of MaxClients, consider raising the MaxClients setting
[Mon Aug 15 15:38:48 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Mon Aug 15 16:17:31 2011] [warn] child process 766 still did not exit, sending a SIGTERM
[Mon Aug 15 16:17:31 2011] [warn] child process 767 still did not exit, sending a SIGTERM

어떤 아이디어? 감사!


Keepalive 설정은 무엇입니까? 응용 프로그램으로 일종의 긴 폴링을 수행합니까?
— regilero

답변:


7

mod_status를 사용하여 서버 상태를 확인할 수 있습니다. 연결이 끊어지지 않고 "응답 전송"상태 (W)에 멈춘 연결이있을 수 있습니다. 이 해결 httpd maxclients 및 modstatus 보고서 를 진단하는 방법에 대한이 기사를 확인하십시오.

당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.