Question

How Can I Determine the Root Cause of Apache Threads Maxing Out?

Asked by: GoSox2008

I've run in to a rather red-herring-like situation that I'm hoping some of you good folks can shed some light on.  First some background:

This Apache Web Server is being used as a front end for a J2EE application that accepts incoming connections from clients out in the field rather frequently.  Every 60 seconds or so the client will send a message to the J2EE application just to say "Hi, I'm here.".  There also can be remote interaction with these clients as well.

The actual issue I've been chasing down for months is that from the J2EE application's point of view, some clients (a random subset) will stop communicating with the J2EE application.  However viewing a client log from a client that is allegedly not reporting, it shows unknown host errors for the Apache Server.

Taking a thread count of the Apache threads yields that the threads have maxed out at 503.  I'm just getting a thread count with your standard "ps -ef | grep http | wc -l" command.   My results are below.
I've also placed an httpd.conf snippet below as well.

Lastly, we have the following compiled in Apache:

  core.c
  mod_log_config.c
  mod_setenvif.c
  mod_ssl.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_alias.c
  mod_so.c

Any help would be much, much appreciated.

Best Regards,
Josh

PS: I have changed all of the addresses in the netstat for security purposes, of course.

================================================================================================================
Netstat Results
================================================================================================================
Local Address,         Foreign Address,            (state),
local_address_1.www,   foreign_address_1.16194     , CLOSE_WAIT	
local_address_1.www,   foreign_address_2.60599     , CLOSE_WAIT	
local_address_1.443,   foreign_address_2.60839     , CLOSE_WAIT	
local_address_1.443,   foreign_address_3.20613     , CLOSE_WAIT
local_address_1.443,   foreign_address_3.45379     , CLOSE_WAIT
local_address_1.www,   foreign_address_3.45745     , CLOSE_WAIT
local_address_1.www,   foreign_address_3.45775     , CLOSE_WAIT
local_address_1.www,   foreign_address_3.46061     , CLOSE_WAIT
local_address_1.www,   foreign_address_4.11653     , CLOSE_WAIT
local_address_1.443,   foreign_address_4.11923     , CLOSE_WAIT
local_address_1.443,   foreign_address_4.12028     , CLOSE_WAIT
local_address_1.443,   foreign_address_5.35389     , CLOSE_WAIT
local_address_1.443,   foreign_address_6.10749     , CLOSE_WAIT
local_address_1.www,   foreign_address_6.10960     , CLOSE_WAIT
local_address_1.443,   foreign_address_6.11440     , CLOSE_WAIT
local_address_1.443,   foreign_address_7.31565     , CLOSE_WAIT
local_address_1.443,   foreign_address_7.32095     , CLOSE_WAIT
local_address_1.443,   foreign_address_8.27290     , CLOSE_WAIT
local_address_1.443,   foreign_address_8.28009     , CLOSE_WAIT
local_address_1.www,   foreign_address_8.28033     , CLOSE_WAIT
local_address_1.www,   foreign_address_8.3556      , CLOSE_WAIT
local_address_1.www,   foreign_address_9.21388     , CLOSE_WAIT
local_address_1.www,   foreign_address_10.55432    , CLOSE_WAIT
local_address_1.www,   foreign_address_11.55803    , CLOSE_WAIT
local_address_1.www,   foreign_address_12.26118    , CLOSE_WAIT
local_address_1.www,   foreign_address_13.49844    , CLOSE_WAIT
local_address_1.443,   foreign_address_14.s.54361  , CLOSE_WAIT
local_address_1.443,   foreign_address_14.s.55122  , CLOSE_WAIT
local_address_1.443,   foreign_address_15.20497    , CLOSE_WAIT
local_address_1.www,   foreign_address_15.20763    , CLOSE_WAIT
local_address_1.www,   foreign_address_15.45526    , CLOSE_WAIT
local_address_1.443,   foreign_address_16.3557     , CLOSE_WAIT
local_address_1.443,   foreign_address_16.3623     , CLOSE_WAIT
local_address_1.443,   foreign_address_16.3660     , CLOSE_WAIT
local_address_1.443,   foreign_address_16.3691     , CLOSE_WAIT
local_address_1.443,   foreign_address_16.3693     , CLOSE_WAIT
local_address_1.443,   foreign_address_16.3696     , CLOSE_WAIT
local_address_1.443,   foreign_address_16.3705     , CLOSE_WAIT
local_address_1.443,   foreign_address_16.3707     , CLOSE_WAIT
local_address_1.www,   foreign_address_16.3709     , CLOSE_WAIT
local_address_1.www,   foreign_address_16.3712     , CLOSE_WAIT
local_address_1.www,   foreign_address_17.4908     , CLOSE_WAIT
local_address_1.www,   foreign_address_17.54341    , CLOSE_WAIT
local_address_1.www,   foreign_address_18.l.22196  , CLOSE_WAIT
local_address_1.www,   foreign_address_18.l.22356  , CLOSE_WAIT
local_address_1.www,   foreign_address_18.l.46641  , CLOSE_WAIT
local_address_1.www,   foreign_address_19.59834    , CLOSE_WAIT
local_address_1.www,   foreign_address_20.6521     , CLOSE_WAIT
local_address_1.443,   foreign_address_20.6665     , CLOSE_WAIT
local_address_1.443,   foreign_address_20.6701     , CLOSE_WAIT
local_address_1.443,   foreign_address_21.36324    , CLOSE_WAIT
local_address_1.443,   foreign_address_21.36661    , CLOSE_WAIT
local_address_1.443,   foreign_address_22.cp.26188 , CLOSE_WAIT
local_address_1.443,   foreign_address_23.13950    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14043    , CLOSE_WAIT
local_address_1.www,   foreign_address_23.14109    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14120    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14133    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14150    , CLOSE_WAIT
local_address_1.www,   foreign_address_23.14165    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14201    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14226    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14269    , CLOSE_WAIT
local_address_1.www,   foreign_address_23.14292    , CLOSE_WAIT
local_address_1.www,   foreign_address_23.14322    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14336    , CLOSE_WAIT
local_address_1.443,   foreign_address_23.14338    , CLOSE_WAIT
local_address_1.443,   foreign_address_24.39104    , CLOSE_WAIT
local_address_1.443,   foreign_address_25.38173    , CLOSE_WAIT
local_address_1.443,   foreign_address_26.58945    , CLOSE_WAIT
local_address_1.443,   foreign_address_26.2175     , CLOSE_WAIT
local_address_1.443,   foreign_address_26.2183     , CLOSE_WAIT
local_address_1.443,   foreign_address_26.2190     , CLOSE_WAIT
local_address_1.443,   foreign_address_26.2224     , CLOSE_WAIT
local_address_1.443,   foreign_address_26.2231     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2141     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2144     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2162     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2173     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2176     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2179     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2186     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2190     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2199     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2206     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2209     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2212     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2219     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2221     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2222     , CLOSE_WAIT
local_address_1.www,   foreign_address_27.2227     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2231     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.2234     , CLOSE_WAIT
local_address_1.443,   foreign_address_27.51784    , CLOSE_WAIT
local_address_1.443,   foreign_address_28.44566    , CLOSE_WAIT
local_address_1.443,   foreign_address_29.44592    , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4008     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4016     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4037     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4041     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4044     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4047     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4052     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4058     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4065     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4067     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4068     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4071     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4074     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4078     , CLOSE_WAIT
local_address_1.443,   foreign_address_30.4087     , CLOSE_WAIT
local_address_1.443,   foreign_address_31.14485    , CLOSE_WAIT
local_address_1.443,   foreign_address_32.4196     , CLOSE_WAIT
local_address_1.443,   foreign_address_32.4198     , CLOSE_WAIT
local_address_1.443,   foreign_address_33.15291    , CLOSE_WAIT
local_address_1.443,   foreign_address_33.15597    , CLOSE_WAIT
local_address_1.www,   foreign_address_34.50549    , CLOSE_WAIT
local_address_1.443,   foreign_address_35.20621    , CLOSE_WAIT
local_address_1.443,   foreign_address_36.47187    , CLOSE_WAIT
local_address_1.443,   foreign_address_37.31364    , CLOSE_WAIT
local_address_1.443,   foreign_address_38.39666    , CLOSE_WAIT
local_address_1.443,   foreign_address_5.35950     , ESTABLISHE
local_address_1.443,   foreign_address_8.27605     , ESTABLISHE
local_address_1.443,   foreign_address_38.59375    , ESTABLISHE
local_address_1.443,   foreign_address_39.cp.26337 , ESTABLISHE
local_address_1.443,   foreign_address_23.14369    , ESTABLISHE
local_address_1.443,   foreign_address_27.2237     , ESTABLISHE
local_address_1.443,   foreign_address_40.56387    , LAST_ACK
local_address_1.443,   foreign_address_16.3585     , LAST_ACK
local_address_1.443,   foreign_address_16.3589     , LAST_ACK
local_address_1.www,   foreign_address_16.3625     , LAST_ACK
local_address_1.443,   foreign_address_16.3631     , LAST_ACK
local_address_1.443,   foreign_address_41.13230    , LAST_ACK
local_address_1.www,   foreign_address_20.7237     , LAST_ACK
local_address_1.443,   foreign_address_21.36334    , LAST_ACK
local_address_1.www,   foreign_address_23.13854    , LAST_ACK
local_address_1.443,   foreign_address_42.58060    , LAST_ACK
local_address_1.443,   foreign_address_43.59057    , LAST_ACK
local_address_1.443,   foreign_address_27.2094     , LAST_ACK
local_address_1.443,   foreign_address_27.2103     , LAST_ACK
local_address_1.443,   foreign_address_27.2113     , LAST_ACK
local_address_1.443,   foreign_address_27.2124     , LAST_ACK
local_address_1.443,   foreign_address_27.2156     , LAST_ACK
local_address_1.443,   foreign_address_27.2184     , LAST_ACK
local_address_1.www,   foreign_address_30.3944     , LAST_ACK
local_address_1.www,   foreign_address_30.3983     , LAST_ACK
local_address_1.www,   foreign_address_30.3985     , LAST_ACK
local_address_1.443,   foreign_address_30.4018     , LAST_ACK
local_address_1.443,   foreign_address_30.4032     , LAST_ACK
local_address_1.www,   foreign_address_30.4039     , LAST_ACK
local_address_1.www,   foreign_address_30.4042     , LAST_ACK
local_address_1.www,   foreign_address_30.4043     , LAST_ACK
local_address_1.www,   foreign_address_30.4048     , LAST_ACK
local_address_1.443,   foreign_address_44.4176     , LAST_ACK
local_address_1.443,   foreign_address_45.58708    , LAST_ACK
local_address_1.www,   foreign_address_45.59205    , LAST_ACK
 
================================================================================================================
httpd.conf
================================================================================================================
 
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
 
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
 
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
 
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15
 
##
## Server-Pool Size Regulation (MPM specific)
## 
 
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers         5
MinSpareServers      5
MaxSpareServers     10
ServerLimit	   512
MaxClients         500
MaxRequestsPerChild  500000
</IfModule>
 
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75 
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>
 
# perchild MPM
# NumServers: constant number of server processes
# StartThreads: initial number of worker threads in each server process
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# MaxThreadsPerChild: maximum number of worker threads in each server process
# MaxRequestsPerChild: maximum number of connections per server process
<IfModule perchild.c>
NumServers           5
StartThreads         5
MinSpareThreads      5
MaxSpareThreads     10
MaxThreadsPerChild  20
MaxRequestsPerChild  0
</IfModule>
 
# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum  number of requests a server process serves
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild  0
</IfModule>
 
# BeOS MPM
# StartThreads: how many threads do we initially spawn?
# MaxClients:   max number of threads we can have (1 thread == 1 client)
# MaxRequestsPerThread: maximum number of requests each thread will process
<IfModule beos.c>
StartThreads               10
MaxClients                 50
MaxRequestsPerThread       10000
</IfModule>    
 
# NetWare MPM
# ThreadStackSize: Stack size allocated for each worker thread
# StartThreads: Number of worker threads launched at server startup
# MinSpareThreads: Minimum number of idle threads, to handle request spikes
# MaxSpareThreads: Maximum number of idle threads
# MaxThreads: Maximum number of worker threads alive at the same time
# MaxRequestsPerChild: Maximum  number of requests a thread serves. It is 
#                      recommended that the default value of 0 be set for this
#                      directive on NetWare.  This will allow the thread to 
#                      continue to service requests indefinitely.                          
<IfModule mpm_netware.c>
ThreadStackSize      65536
StartThreads           250
MinSpareThreads         25
MaxSpareThreads        250
MaxThreads            1000
MaxRequestsPerChild      0
</IfModule>
 
# OS/2 MPM
# StartServers: Number of server processes to maintain
# MinSpareThreads: Minimum number of idle threads per process, 
#                  to handle request spikes
# MaxSpareThreads: Maximum number of idle threads per process
# MaxRequestsPerChild: Maximum number of connections per server process
<IfModule mpmt_os2.c>
StartServers           2
MinSpareThreads        5
MaxSpareThreads       10
MaxRequestsPerChild    0
</IfModule>
 
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
 
Listen 80
Listen 443
                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-10-06 at 07:04:31ID23790429
Tags

Apache HTTP Project

,

Apache

,

2.0.48

,

Running on AIX

Topic

Apache Web Server

Participating Experts
1
Points
500
Comments
8

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Apache httpd.conf options
    Hi, I've got lots of systems I came across that had httpd.conf set like this (Apache 1.3.x in RedHat Linux 6.x or 7.x): DocumentRoot=/usr/local/apache/htdocs <directory /> order allow,deny allow from all Option FollowSymlinks </directory> <directory "/u...
  2. Apache Modules...httpd.conf
    I have installed apache 2.0.43 on a Solaris 8 machine...I used the following elements when running .configure --enable-modules=all --prefix=/opt/foo --with-mpm=prefork Apache runs with the basic httpd.conf, but when I try to apply the httpd.conf that the previous developer ...
  3. Apache -httpd.conf error
    My problem is that Apache won't start up. The error coming back is: Syntax error on line nnn of /etc/httpd/conf/httpd.conf: ScriptAlias takes two arguments, a fakename and a realname That line looks like: ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"" Would s...
  4. Apache not recognizing httpd.conf commands
    I have just upgraded from apache 1.3.28 to apache 1.3.33 with mod_ssl. When I try to start the new apache, I get errors like this: Syntax error on line 333 of /www/conf/httpd.conf: Invalid command 'Order', perhaps mis-spelled or defined by a module not included in the server...
  5. Apache Configuration httpd.conf
    Guys, I have a dedicated p4 2+ Ghz server with one instance of Apache 2.0.54+ running. RAM: 512 MB OS: Fedora 5.0 Yesterday I have installed Lace Chat from (http://socket7.net/lace/) Its a very simple ajax chat. The problem I had was that CPU utilization is reaching 60% and ...
  6. Running Apache with Multiple httpd.conf files - Linux.
    Hello, I am trying to run an Apache2 binary with multiple httpd.conf files. I have a server with two NIC cards, each of which is configured and active. One httpd.conf is listening on the first NIC address. The second httpd.conf has the second NIC. Both httpd.conf files s...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: GoSox2008Posted on 2008-10-06 at 07:33:20ID: 22650408

In addition I also wrote a little script that takes a netstat every minute.  In the snippet below you can see that the thread count escalates very, very, quickly.

Fri Oct  3 16:09:00 EDT 2008      20
Fri Oct  3 16:10:00 EDT 2008      26
Fri Oct  3 16:11:00 EDT 2008      22
Fri Oct  3 16:12:00 EDT 2008      22
Fri Oct  3 16:13:00 EDT 2008      23
Fri Oct  3 16:14:00 EDT 2008      21
Fri Oct  3 16:15:00 EDT 2008      22
Fri Oct  3 16:16:00 EDT 2008      22
Fri Oct  3 16:17:00 EDT 2008      20
Fri Oct  3 16:18:00 EDT 2008      21
Fri Oct  3 16:19:00 EDT 2008      21
Fri Oct  3 16:20:00 EDT 2008      39
Fri Oct  3 16:21:00 EDT 2008     107
Fri Oct  3 16:22:00 EDT 2008     166
Fri Oct  3 16:23:00 EDT 2008     225
Fri Oct  3 16:24:00 EDT 2008     296
Fri Oct  3 16:25:00 EDT 2008     351
Fri Oct  3 16:26:00 EDT 2008     404
Fri Oct  3 16:27:00 EDT 2008     464
Fri Oct  3 16:28:00 EDT 2008     502
Fri Oct  3 16:29:00 EDT 2008     503
Fri Oct  3 16:30:00 EDT 2008     502
Fri Oct  3 16:31:00 EDT 2008     503
Fri Oct  3 16:32:00 EDT 2008     503
Fri Oct  3 16:33:00 EDT 2008     503
Fri Oct  3 16:34:01 EDT 2008     502
Fri Oct  3 16:35:00 EDT 2008     503
Fri Oct  3 16:36:00 EDT 2008     503
Fri Oct  3 16:37:00 EDT 2008     503
Fri Oct  3 16:38:00 EDT 2008     502
Fri Oct  3 16:39:00 EDT 2008     502
Fri Oct  3 16:40:00 EDT 2008     503

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:

Select allOpen in new window

 

by: urgollPosted on 2008-10-06 at 08:19:13ID: 22650926

The question is, how many clients do you expect to service ? Since your client connects at least every 60 seconds, you apache server needs to be tuned.

You are running the prefork MPM, which corresponds to this part of the config file:
<IfModule prefork.c>
StartServers         5
MinSpareServers      5
MaxSpareServers     10
ServerLimit         512
MaxClients         500
MaxRequestsPerChild  500000
</IfModule>

There you have a hard limit of 500 child processes. Since you have keepalives enabled with a KeepAliveTimeout of 15 seconds, a rough calculations yields a maximum number of servicable clients of around 2000, assuming simple 'I am here' transactions.

How does this compare with your true number of client applications ?

Regards,
Christophe

 

by: GoSox2008Posted on 2008-10-06 at 08:22:51ID: 22650962

Hi Christophe,
I've got about 250 clients.

 

by: urgollPosted on 2008-10-06 at 09:28:33ID: 22651735

I see that you have both SSL and non-SSL connections, so that would double the number of connections per client.

For the sake of experimenting, can you disable keepalives ? This is done with
KeepAlive Off
(instead of On).

Restart apache after this change, and monitor again the number of processes running.

Another question, do you have any insight into the client ? Do you know if the client is opening multiple connections to the server, like a regular browser would ?

Leaving aside your specific case, a regular browser often use 4 parallel connections to the server (because a web page has many components, like css, images, etc). So 256 clients connecting at once would use 1024 connections for up at least 15 seconds due to keepalive. Double that if you have a mix of SSL and non-SSL, and you see how easy it is to bust your 500 connections limit.

Regards,
Christophe

 

by: GoSox2008Posted on 2008-10-06 at 09:57:24ID: 22652017

Hi Christophe,
I'll elaborate a bit further on the client communication.  So there is a SOAP message post by about 125 clients to a servlet on the J2EE application server about every 60 seconds.  The other 125 clients are different.  So those clients post to a different servlet.  That post is just a standard HTTP 1.1 post.  The first set of clients uses SSL, the second does not.

The client should not be opening multiple connections to the server...that I know of.  I'll have to check on that specifically.  Your explanation above does make sense if there are multiple connections.

I also have attached a snippet from my httpd.conf file that shows the virtual hosts that I'm dealing with.  I figured since you mentioned the KeepAlive settings that this might be of interest to you.

I will turn the KeepAlive to Off on the httpd.conf.  As that takes care of TIME_WAIT states, will that resolve CLOSE_WAIT too?

Thanks for your assistance.  It is much, much appreciated!

Best Regards,
Josh

<VirtualHost *:443>
    <!-- SSL Certificate Information Removed -->
    <Location /eMessage>
        WebLogicHost machine.domain.com
        WebLogicPort 80
        SetHandler weblogic-handler
        ConnectRetrySecs 2
        ConnectTimeoutSecs 20
        Debug OFF
        #DebugConfigInfo ON
        FileCaching OFF
        KeepAliveEnabled ON
        KeepAliveSecs 300
        MaxPostSize -1
        WLIOTimeoutSecs 900
        WLLogFile /opt/apache/logs/wlproxy_log
        WLSocketTimeoutSecs 5
        SSLRequire (%{SSL_CLIENT_S_DN_CN} eq "CNMyClient")
    </Location>
</VirtualHost>
 
<VirtualHost *:80>
	<Location /pgetsession>
	    WebLogicHost machine.domain.com
	    WebLogicPort 80 
	    SetHandler weblogic-handler
	    ConnectRetrySecs 2
	    ConnectTimeoutSecs 20
	    Debug OFF
	    #DebugConfigInfo ON
	    FileCaching OFF
	    KeepAliveEnabled ON
	    KeepAliveSecs 300
	    MaxPostSize -1
	    WLIOTimeoutSecs 900
	    WLLogFile /opt/apache/logs/wlproxy_log
	    WLSocketTimeoutSecs 5
	#   Debug ALL
	</Location>
</VirtualHost>

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:

Select allOpen in new window

 

by: GoSox2008Posted on 2008-10-06 at 10:05:38ID: 22652092

Hi Christophe,
Below is the entire httpd.conf.  I've actually set the keepalive to off using the setenvif module now that I think about it.  You can see it below.

Best Regards,
Josh

 

by: urgollPosted on 2008-10-06 at 11:30:35ID: 22652927

KeepAliveEnabled is a property of the WebLogic plugins, it is for connections from Apache to WebLogic.

I still recommend to turn off KeepAlives, even though it appears that you have then turn off using SetEnvIf.

CLOSE_WAIT happens when the remote client has closed the connection, but the local process hasn't. Keepalive maybe one thing preventing apache from closing the socket, and this counts toward the 500 maximum clients.

Another thing you may do is reduce MaxRequestsPerChild  to a saner value (say 1000) and reduce Timeout to 60 or 120 if you know that none of your requests will take that long.

Let me know how it goes,
Christophe

 

by: GoSox2008Posted on 2008-10-13 at 10:28:28ID: 22704277

Hi Christophe,
The good news is the frequency of the threads maxing out has certainly gone down from once every day or two down to once every 5 days.  I've lowered the MaxRequestsPerChild to 1000 and reduced the timeout to 60 as well.  KeepAlive has been turned off everywhere.  What do you suggest next to eliminate this once and for all?

Best Regards,
Josh

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...