My sites became slow today behind CloudFlare. The response time was between 30 and 60 s in the browser, or it was a timeout.
The application responded fast, the load was between 1 and 2.5 on the servers, CPU usage about 30%.
I thought the problem was with the connections. Restarting www/apache24 helped temporarily. I found nothing in the logs except for a few friendly
However,
The KeepAliveTimeout was 600.
The MPM config was:
This config worked for more than a year. I don’t get how the server could have 7,500 https connections. However, I’ve had never checked it until today.
Then I changed the values. It seems it helped. The new config is KeepAliveTimeout 300 and:
Considering this config, how can I have above 5,000 connections with 30 processes?
Maybe I have a misconception about what ESTABLISHED means or how www/apache24 works. Although it seems that the config change helped, I think I’m looking at the wrong numbers as 31 processes should not have 5445 connections with 64 threads per child unless I got the whole concept wrong.
The application responded fast, the load was between 1 and 2.5 on the servers, CPU usage about 30%.
I thought the problem was with the connections. Restarting www/apache24 helped temporarily. I found nothing in the logs except for a few friendly
sonewconn: pcb 0xfffff8017833c740: Listen queue overflow: 767 already in queue awaiting acceptance (1026 occurrences)
dmesg
lines.However,
netstat -an | grep '.443' | wc
showed between 7,500 and 9,000 connections. The vast majority was established. I don’t know much of the networking, and I don’t get it.The KeepAliveTimeout was 600.
The MPM config was:
<IfModule mpm_event_module>
StartServers 3
ServerLimit 50
MinSpareThreads 50
MaxSpareThreads 500
ThreadsPerChild 50
MaxRequestWorkers 2500
MaxConnectionsPerChild 0
</IfModule>
This config worked for more than a year. I don’t get how the server could have 7,500 https connections. However, I’ve had never checked it until today.
Then I changed the values. It seems it helped. The new config is KeepAliveTimeout 300 and:
<IfModule mpm_event_module>
StartServers 3
ServerLimit 200
MinSpareThreads 50
MaxSpareThreads 500
ThreadsPerChild 64
MaxRequestWorkers 12160
MaxConnectionsPerChild 0
</IfModule>
Considering this config, how can I have above 5,000 connections with 30 processes?
# netstat -an | grep '.443' | wc && netstat -an | grep '.443' | grep ESTABLISHED | wc && ps auwx | grep httpd | wc
5449 32694 425008
5445 32670 424710
31 342 2872
Maybe I have a misconception about what ESTABLISHED means or how www/apache24 works. Although it seems that the config change helped, I think I’m looking at the wrong numbers as 31 processes should not have 5445 connections with 64 threads per child unless I got the whole concept wrong.