Bug 52391 - 100% CPU usage while using Forward Proxy
Summary: 100% CPU usage while using Forward Proxy
Status: RESOLVED WORKSFORME
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: All (show other bugs)
Version: 2.2.21
Hardware: PC All
: P2 critical (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks: 52870
  Show dependency tree
 
Reported: 2011-12-27 19:07 UTC by Sam Van Brussel
Modified: 2016-05-16 15:16 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Van Brussel 2011-12-27 19:07:14 UTC
Dear,

At a certain point in time, httpd.exe starts using 100% cpu (one thread, so 12,5% on my 8-core machine). Over time, this shifts to 25%, 37,5%, 50% and higher, so I restart the service. I started noticing it since version 2.2.17.

The configuration file httpd.conf is the standard one with the following additions:

#Begin custom modules SVB

LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so

#End custom modules SVB

#Begin custom settings SVB

<IfModule mod_cache.c>
	<IfModule mod_disk_cache.c>
		CacheDirLength 1
		CacheDirLevels 2
		CacheMaxFileSize 1000000000
		CacheMinFileSize 1
		CacheRoot T:\Apache\HTTPD\CacheRoot
		CacheEnable disk /
	</IfModule>
</IfModule>

ProxyRequests On
ProxyVia On

<Proxy *>
	Order deny,allow
	Deny from all
	Allow from 192.168.1
</Proxy>

#End custom settings SVB

Can I help you by adding a memory dump file and some log files?

Kind regards,

Sam
Comment 1 William A. Rowe Jr. 2011-12-27 22:55:58 UTC
First, begin by setting both EnableSendfile / EnableMMAP off - and then also
try DisableWin32AcceptEx.

It's important to eliminate these optimizations to be sure it doesn't have
something to do with your network driver stack.
Comment 2 Sam Van Brussel 2011-12-29 23:10:48 UTC
Dear,

I've uncommented the EnableMMAP and EnableSendfile lines in the httpd.conf file

#
# EnableMMAP and EnableSendfile: On systems that support it, 
# memory-mapping or the sendfile syscall is used to deliver
# files.  This usually improves server performance, but must
# be turned off when serving from networked-mounted 
# filesystems or if support for these functions is otherwise
# broken on your system.
#
EnableMMAP off
EnableSendfile off

I'll re-evaluate the new configuration. I couldn't find much documentation about the DisableWin32AcceptEx and haven't applied it yet.

Kind regards,

Sam
Comment 3 Sam Van Brussel 2011-12-30 08:57:02 UTC
The issue seems to occur a lot less. Before your fix, it was pretty easy to get load on the httpd.exe process and even move to 100% CPU (one idle httpd.exe and one httpd.exe that moves all cores to 100%). After your fix, I've only got a single spike to 12,5%.

I even noted something interesting: as soon as I closed my browser, httpd.exe went completely idle.

I use Firefox and enable the pipeline settings (I'm doing that for years).

network.http.pipelining;true
network.http.pipelining.maxrequests;8
network.http.pipelining.ssl;true
network.http.proxy.pipelining;true

Could it be that Firefox overloads Apache?

Kind regards,

Sam
Comment 4 Eric Covener 2016-05-16 15:16:24 UTC
Last update 4.5 years ago