
저는 몇 분 안에 0~50,000명의 클라이언트를 한 번에 이동할 수 있는 "서지 트래픽" 앱을 구축 중입니다. 제가 여기서 뭔가 잘못하고 있는지 이해하는데 도움을 달라고 여러분께 부탁드리고 싶다고 생각했습니다.
현재 저는 loader.io로 테스트 중입니다. 이 부하 테스트에 대한 구성은 1분 동안 클라이언트 0~10,000개입니다. 테스터가 수행하는 유일한 작업은 로그인 페이지를 로드하는 것뿐입니다. 그 이상은 아니며 심지어 로그인도 하지 않습니다. 페이지 크기는 793KB로 실제 브라우저에서 로드 시간은 ~400ms에 해당합니다.
[01-Mar-2018 09:57:48] WARNING: [pool app.com] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 4244 idle, and 4607 total children
[01-Mar-2018 09:57:49] WARNING: [pool app.com] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 4216 idle, and 4615 total children
[01-Mar-2018 09:57:50] WARNING: [pool app.com] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 4211 idle, and 4631 total children
[01-Mar-2018 09:57:52] WARNING: [pool app.com] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 4179 idle, and 4663 total children
[01-Mar-2018 09:57:54] WARNING: [pool app.com] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 4181 idle, and 4695 total children
[01-Mar-2018 09:57:57] WARNING: [pool app.com] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 4244 idle, and 4727 total children
[01-Mar-2018 09:57:58] WARNING: [pool app.com] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 4412 idle, and 4759 total children
내 php-fpm 구성은 다음과 같습니다.
pm.max_children 3000
pm.max_requests 200
pm dynamic
pm.start_servers 1500
pm.min_spare_servers 300
pm.max_spare_servers 1500
호스트 서버 사양:
AMD Opteron(tm) Processor 6344
Core Name
Abu Dhabi
# of Cores
12-Core
# of Threads
12
Operating Frequency
2.6 GHz
Hyper Transports
6.40 GT/s
L2 Cache
6 x 2MB
L3 Cache
2 x 8MB
Manufacturing Tech
32 nm
50GB RAM (I have provided this to the container), server has 64 total.
그리고 이상하게도 이 구성에도 불구하고 여전히 "바빠 보입니다"라는 메시지가 표시됩니다!
여기서 기억해야 할 가장 중요한 점은 일반적으로 트래픽이 거의 또는 전혀 없기 때문에 몇 분 내에 최대 50,000명의 사용자가 발생할 것으로 예상된다는 것입니다. 이 오류를 해결하도록 도와주실 수 있나요? 감사해요!
답변1
추가 작업자를 가동시키는 데는 시간이 걸리며 로그에서 볼 수 있듯이 php-fpm은 한 번에 32개의 하위 항목을 생성한다는 점을 명심해야 합니다. 가장 쉬운 "수정"은 최소 및 최대 서버를 동일한 값으로 설정하는 것입니다. 이렇게 하면 해당 서버가 가동될 때까지 기다릴 필요가 없습니다.
또한 가능하다면 그런 작업을 수행하는 대신 캐싱을 구현해 보십시오. 항상 속도가 더 빠르기 때문입니다.