Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

(I know the answer to this question. Posting this just to share the answer with the community)

My local (Windows 7) instance of Apache 2.4 experiences delays or hang-ups when serving some URLs, depending on which browser I use to access these URLs.

With Firefox/Chrome, Apache is slow to respond on certain URLs. The sluggishness occurs about 20% of the time on any given URL. When it does occur, there's a 5-second delay during which Firefox displays a "Waiting for..." status.

With Internet Explorer 9, Apache simply hangs and stops serving any requests (with any browser) until it is restarted.

  • This seems to occur only with dynamic (PHP) requests, but not all of them. In fact, it only occurs on one specific site. Other PHP-based sites on the same machine work fine.
  • It may or may not be significant that the problematic site consists of a large number of subdomains (VirtualHosts).
  • Disabling the Windows Firewall and Comodo Firewall doesn't help.
  • The problem seems more frequent with "busier" pages (additional requests for IFRAMES etc.)

I've tried many changes to httpd.conf (such as disabling KeepAlive, EnableMMAP, HostnameLookups) but nothing seems to work.

share|improve this question
    
Once you have some up-votes, you'll have the reputation to move the answer into a real answer, which you should do then. (If nothing else, the upvotes will get you more reputation then.) –  pjmorse Dec 7 '12 at 2:50
add comment

1 Answer 1

Answered by Thomasz


The solution is to add the following to your httpd.conf:

AcceptFilter http none
AcceptFilter https none

On Windows, this has the effect of disabling the AcceptEx() API (part of WinSock), which offers some performance improvements, but probably conflicts with Comodo Firewall.

Putting Comodo Firewall in "Disabled" mode doesn't help because requests probably still go through Comodo's networking code. I think Comodo would have to be uninstalled completely to eliminate the problem (though I haven't tried it).

If you have a similar problem with Apache 2.2, you should use the Win32DisableAcceptEx directive instead.

References

Quoting from http://httpd.apache.org/docs/2.4/mod/core.html:

The default values on Windows are:

AcceptFilter http data

AcceptFilter https data

Window's mpm_winnt interprets the AcceptFilter to toggle the AcceptEx() API, and does not support http protocol buffering. There are two values which utilize the Windows AcceptEx() API and will recycle network sockets between connections. data waits until data has been transmitted as documented above, and the initial data buffer and network endpoint addresses are all retrieved from the single AcceptEx() invocation. connect will use the AcceptEx() API, also retrieve the network endpoint addresses, but like none the connect option does not wait for the initial data transmission.

On Windows, none uses accept() rather than AcceptEx() and will not recycle sockets between connections. This is useful for network adapters with broken driver support, as well as some virtual network providers such as vpn drivers, or spam, virus or spyware filters.

See also: http://forums.comodo.com/help-for-comodo-antivirus/conflict-with-apache-t260.0.html;msg31636#msg31636

share|improve this answer
    
I've been having issues with IE10 causing Apache2.4 (no comodo involved) to hang until the service is restarted - and changing the .conf to include these fixed it. Thanks for posting this. –  matt lohkamp Aug 15 '13 at 0:26
    
This worked for me as well. I also gathered some more references on my blog as the info about this topic is very scattered at the moment. –  Stijn de Witt Jan 9 at 23:55
    
Worked for me, Win 7 x64. I wonder why none is not the default setting in Apache? Most other 'innovative' features are disabled by default in Apache :P –  rustyx May 18 at 12:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.