17

My question is what is the maximum number of users that Apache webserver 2.2.2 can handle, i have a website which sometimes gets over 300+ concurrent users, however apache default configuration is set to max 150, i know i can increase this value, however if i do i fear that i might run over the capacity that Apache can handle, my server is quite powerful with 8 quad core AMD processor with 16 GM memory

  1. How do i determine how many requests that apache can handle,

  2. In general what the options/configurations for a best optimised for server loads. i.e disable keep alive ..etc

  3. When i increase the max user size , MySql eats up most of the processor power with going over 150% CPU sometimes .... not sure why ..

Any experts ?

mahen3d
  • 7,047
  • 13
  • 51
  • 103

4 Answers4

8

Apache comes with 40-100 max threads. It can be increased to allow more threads to be handled at the same time.

The application should be monitored before making any changes to it. Based on the response, try to change "ThreadsPerChild" and "AcceptThreads" accordingly.

The default amount of "maximum" number of threads is usually enough; however, there can be conditions where this number may have to be increased. The threads usage can be monitored. To monitor, start the Administrative instance, select the HTTP server in question, and select Real Time Server Statistics at the bottom left.

If Idle Threads is close to or at zero, this is a problem. As long as Idle Threads is zero, no new client connections can be established. New clients will be put into a wait status until a thread becomes available. Our recommendation for this condition is to add the directive ThreadsPerChild with an increased value, approximately double the current value if it was in the range of 40 to 100, or plus 50, if it was above 100. The required minimum value (for the maximum parameter) can only be found by trial and error. If after increasing the value, the server runs smoothly, stop testing.

(source)

j0k
  • 22,600
  • 28
  • 79
  • 90
user1268571
  • 79
  • 1
  • 2
3

Recommendations

Please use Keep Alive as it will increase the performance of your server. Disable keep Alive settings only when there is a firewall in between web or app. Or you are facing package drop issues/connection reset msg.

  • You can increase max client limit but the limit will totally depends upon your server configuration. On an average each apache thread will take let say 25MB , then in that case you have keep max client value to (MAX*load on each thread)/(RAM allocated*threads). Always maintain this ratio to 1/2.
  • You can increase your users to any numbers as explained above by increase max client and server limits of your systems.
  • Always define min-maxspare or min-maxthread limits.
  • One very important point if you are unable to increase the max client limit , just increase the listen backlog limit it will take the extra requests in the queue which in turn prevents the connection drop.
000
  • 26,951
  • 10
  • 71
  • 101
Sourabh Sharma
  • 161
  • 2
  • 5
  • i tried to use the keep-alive, but i found that it significantly decreases the server response time, it was the advise from someone else too, to disable the keep-alive. – mahen3d Dec 16 '12 at 23:53
  • 1
    @Sourabh Sharma : You have pointed that we can increase listen backlog limit to keep in queue so How to increase listen backlog limit in apache. ? – BSB Oct 29 '18 at 10:23
1

See this guide for an overview: http://www.devside.net/articles/apache-performance-tuning

It's all mostly about the Apache MPM that you have selected (thread based, or process based) and it's settings.

Then you need to match it up with the KeepAlive settings (I use a thread based MPM and hence set KeepAlives to On and for 3 seconds).

Are you using Apache under Linux or Windows? Which MPM?

rightstuff
  • 6,412
  • 31
  • 20
1

You will have to edit the httpd.h file to allow for a greater maxclients past the 256 hard coded limit and then recompile the httpd program. This is suggested in the configuration file for httpd.