This is good info. Thanks for posting!!
John
[EMAIL PROTECTED] wrote:
From: Antonio Fiol Bonnín <fiol.bonnin () terra ! es> Subject: Production server tuning
For the first case, I reckon I might have found the cause: Apache MaxClients is set to 200, and Tomcat maxProcessors was set to something about 150. Taking into account that there are 3 Apache, that means 200 x 3 = 600 clients --> tomcat chokes. Just raised maxProcessors to 601 ;-)
In terms of setting MaxClients, look at the size of each web server process (via ps), and compare that with the amount of available memory on the machine. You can set MaxClients to a high a number as will fit in physical ram.
You don't want to set MaxClients too high -- if your machine starts paging heavily, that will really slow things down.
For the second one, I have really no clue: Apache MaxSpareServers is set to 10. I see more than 30 "ESTABLISHED" connections even with extremely load.
This is a case where mod_status is really helpful. Add this to your apache configuration.
ExtendedStatus On .... <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from localhost </Location>
With that in place,
lynx -dump http://localhost/server-status?auto # omit "?auto" for more verbose details
Look at the scoreboard section of the output. You should see a series of the letters K, W, R. K is server in keepalive state. W is a server in that is writing a response. R is a server that is reading a response.
Start collecting the output, say, at 10 minute intervals. Once you've got a representative set of data, start looking through it:
- Are there a lot of servers in KeepAlive state? If so, try decreasing KeepAliveTimeout.
- Is the number of busy server processes near MaxClients? If so, consider raising MaxClients (if the machine has enough physical ram to handle it). Otherwise, consider adding another web server to your front end.
- If the bottleneck is on the backend, adding another application server is a completely reasonable thing to do.
Other things to look at:
- monitor memory usage (vmstat, or some such). If your machines are paging, add ram. Do this on web and application servers.
- montior load (aka uptime). If the loads are consistently high, your best bet is probably to throw more hardware at the problem :)
- Are you logging response times? (Apaches %T, or something at the application level in your servlets/jsp pages). Is there a particular servlet, or jsp page that's taking excessively long?
- Are you doing reverse dns lookups (HostnameLookups On). If so, turn them off.
As far as apache tuning,
http://httpd.apache.org/docs/misc/perf-tuning.html
Is a good start. I don't have a good tomcat reference, though.
hth.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]