Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web server maximum number of users apache can handle?

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 ?

like image 538
mahen3d Avatar asked May 25 '12 01:05

mahen3d


People also ask

What is server limit in Apache?

Server LimitationsThe default Apache setting for MaxClients is 256, however the fact that other distributions often use different values as the default setting must be taken into consideration. Given a desire to set the MaxClients value greater than 256, the ServerLimit setting must also be increased correspondingly.

How many requests can a Apache web server handle?

By default, Apache Request limit is 160 requests per second, that is, Apache can handle up to 160 requests per second, without any modification.

How many threads can Apache handle?

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.

What is the maximum number of simultaneous client connections this web server can handle?

On the TCP level the tuple (source ip, source port, destination ip, destination port) must be unique for each simultaneous connection. That means a single client cannot open more than 65535 simultaneous connections to a single server. But a server can (theoretically) serve 65535 simultaneous connections per client.


2 Answers

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)

like image 94
user1268571 Avatar answered Oct 01 '22 13:10

user1268571


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.
like image 23
Sourabh Sharma Avatar answered Oct 01 '22 11:10

Sourabh Sharma