Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Howto increase performance. |
|
Author |
|
codecr
Joined: 07 May 2008 Posts: 4 Location: Costa Rica
|
Posted: Wed 07 May '08 17:14 Post subject: Howto increase performance. |
|
|
Hi!
I've an Apache 2.2.8 running in a Windows 2003 R2. The site have an average of 1.5 million hits per day and the performance is not the best at this moment. The server handle just static content (no php or cgi).
Do you have recomendation about the parameters that I can tune up? The memory consumption is around 150 MB
Right now we have:
ThreadsPerChild 250
MaxRequestsPerChild 15000
EnableMMAP off
EnableSendfile off
Win32DisableAcceptEx on
and the other parameters are using the default (most of the unused modules are off)
any help will be appreciate!
Best regards,
Gerardo |
|
Back to top |
|
VoodooMill
Joined: 11 Jan 2007 Posts: 60
|
Posted: Thu 08 May '08 1:30 Post subject: |
|
|
We have about the same traffic but also run Perl scripts in addition to our mostly static content. Everything is snappy for us.
The setting that jumps out at me is MaxRequestsPerChild 15000.
At 15000 requests the httpd process serving your pages dies and a new process is being created.
Calculation of even traffic per 24 hours:
1,500,000 reqs / 24 hours = 62,500 reqs/hour
62,500 reqs / 60 mins = 1041.6 reqs/min
15,000 reqs / 1041.6 reqs = httpd process dies and recreates every 14.4 mins.
In addition, I suspect based on the process structure of Apache on Windows that if you're rotating logs with rotatelogs.exe (or cornolog or whatever) those processes are being killed and recreated as well.
Also, if you're like us you do a bulk of your traffic in an 8-10 hour period so this die/recreation process is most likely taking place more frequently than every 14.4 mins.
You didn't mention hardware. Web servers love memory so make sure you have plenty.
If I've made an error anywhere in this someone please feel free to correct.
Hope your get your server running in tip-top Gerardo. |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Thu 08 May '08 1:53 Post subject: |
|
|
A couple of your settings seem contrary to performance:EnableMMAP off
EnableSendfile off Both these Apache features are intended increase performance. Turning them off is usually done to work around buggy network drivers or firewalls. Is this the reason you turned them off?
The Win32DisableAcceptEx directive doesn't take an "on" or "off" parameter. If you have the Win32DisableAcceptEx in your config at all then you have disabled using Window's AcceptEx function which is usually faster than the regular accept function. Like the previous two directives, the default case (no Win32DisableAcceptEx directive) is best for performance. Adding the Win32DisableAcceptEx directive works around network interface problems at the expense of performance.
Two seldom-mentioned directives which can sometimes make a difference are SendBufferSize and ReceiveBufferSize. I don't know of any way to select a good value for these other than just trying different values and measuring the change in performance in your environment. The default value for these buffers on Win2003 is 8192, so that would be a good starting point. In many environments changing these buffer sizes does not make any difference, so don't be too surprised if they don't affect performance for you - but it's worth a try. Don't set either one of them lower than 512 or higher than 1mb because these are the smallest and largest values that Windows will accept.
If your bottleneck is network rather than disk access, then tuning your Windows TCP/IP parameters is more likely to affect performance than Apache parameters. A good starting point for info about Windows TCP/IP parameters is here.
If it is disk access which is limiting your performance you might want to check out the Apache cacheing options.
Hope this helps.
-tom- |
|
Back to top |
|
codecr
Joined: 07 May 2008 Posts: 4 Location: Costa Rica
|
Posted: Thu 08 May '08 21:23 Post subject: |
|
|
Thanks for your invaluable feedback, we change the parameters and we will monitor the performance.
The:
EnableMMAP off
EnableSendfile off
Win32DisableAcceptEx on
were added because we have some problems with the OS, we will try again and see what happens.
Best regards,
Gerardo |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 611 Location: Milford, MA, USA
|
Posted: Fri 09 May '08 5:42 Post subject: |
|
|
FYI - regarding: Code: | EnableMMAP off
EnableSendfile off
Win32DisableAcceptEx | The Windows OS actually supports these features very well on Windows 2000 or higher. SendFile and AcceptEx are the most helpful for performance.
Unfortunately, some 3rd-party network drivers, firewalls, and even a few antivirus programs presume that they are running on ordinary desktop systems and that "no user would ever need these high-performance networking features" - so they do not handle them correctly. This is the real reason many Windows users must disable these performance features.
It is a good idea to check if your network driver, firewall, etc. have any newer release which might let you re-enable these features.
-tom- |
|
Back to top |
|
codecr
Joined: 07 May 2008 Posts: 4 Location: Costa Rica
|
Posted: Fri 09 May '08 17:25 Post subject: |
|
|
Hi!
I just want to update this issue, I implemented the mod_cache and set the
ThreadsPerChild 1000
MaxRequestsPerChild 0
and re-enable the EnableMMAP and EnableSendfile after updating network drivers and now the system runs at peak performance
Thanks for you help!!
Best regards,
Gerardo |
|
Back to top |
|
VoodooMill
Joined: 11 Jan 2007 Posts: 60
|
Posted: Fri 09 May '08 19:07 Post subject: |
|
|
Good to hear. |
|
Back to top |
|
|
|
|
|
|