Mar 14 2008

apache 2 internal dummy connection

Category: 技术ssmax @ 22:54:17


 ::1 – – [13/Mar/2008:23:59:02 +0800] “GET /” 400 460 “-” “-”

看不懂,到apache 的userlist里面问了一下,原来是::1是ipv6的本机表示,真实out了,ipv6都不知道。。。


tcpdump -A -s0 -i any tcp src host ::1

发现了请求内容,原来是。。。Apache internal dummy connection。。。汗啊汗,开头我还以为linux中木马了。。。


I Google’d for “(internal dummy connection)”. There were only a few results explaining what was really happening… many of them were rumors. I found an entry in Yenya’s blog with the same issue. It suggested this is a replacement in Apache 2.x of sending signals to its processes as signals are not available on all platforms. This means during graceful restart, instead a SIGUSR1 to be sent to all child processes, a subrequest is made. The CodeSearch results seem to confirm this. Now, let’s say my server is running ~100 processes and I change anything in my configuration. Would this mean ~100 subrequest at a time ? Yeah, this would be an overhead (over- an already loaded server’s -head) ! Oh, my web servers is being gracefully reloaded each time a log is rotated… ~50 times.  

It seems this feature exists in the whole 2.x series so a downgrade to 2.0 would not solve this issue. It’s just in versions prior to 2.2.0 there was no indication of such internal requests. Some people proposed switching to Worker MPM. However people say that on 2.6.x boxes (my case) Prefork MPM runs faster. Additionally, PHP is not thread-safe by default (the Worker MPM is thread based) and it should be compiled with Zend Thread Safety libraries (–enable-experimental-zts). I don’t think it’s worth… It would be great if there was a way to switch back to the old behaviour on platforms that support it… it’s odd otherwise. Now I’ve disabled the logging for the default website and I’ve left mod_redirect (as I don’t think Apache would follow redirects internally).

P.S.: I suppose signals are also used to terminate a child then the number of request reaches MaxRequestsPerChild, so I experimentaly disabled this limit as it’s used to protect the system from any memory leaks in child processes. However, I haven’t noticed any by now. I hope this will decrease the number of signals sent to the child processes. Let’s check this out…


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.