0

I've configured Apache web server on my CentOs sever machine. I want to increase 5000 concurrent request with MPM_Prefork. Please suggest best Prefork configuration for that. I've done Prefork configuration on httpd.conf file, but its not working.

My Prefork configuration:

<IfModule mpm_prefork_module>
      StartServers                5
      MinSpareServers             30
      MaxSpareServers             40
      MaxClients                  5000
      ServerLimit                 20
      MaxRequestsPerChild         500 
</IfModule>

      KeepAlive       On 
      MaxKeepAliveRequests  5000  
      KeepAliveTimeout       5
  • If you have sufficient RAM you should probably start by increasing the value of the ServerLimit and define the MaxRequestWorkers. – HBruijn Oct 25 '17 at 5:11
  • Thanks for your reply.....What should be the value of ServerLimit for 5000 concurrent requests. I've 16 GB RAM on my server. Is MaxRequestWorker & MaxClients are the different parameters??? – harshu9713 Oct 25 '17 at 5:16
  • I've increased ServerLimit to 5000. But not getting 5000 requests... – harshu9713 Oct 25 '17 at 8:23
  • It has been ages since I used apache 2.2 so I had forgotten that MaxClients is the old, deprecated, but still allowed, directive for MaxRequestWorkers. How are you benchmarking and are you benchmarking with static files or requesting dynamic resources and could it be that it is not apache, but for instance your code/database connection that is the bottleneck? Also when benchmarking, note that it takes a while for Apache to spin up enough workers to handle load; check the process creation section on: httpd.apache.org/docs/2.4/misc/perf-tuning.html - Do you see anything in your error_log – HBruijn Oct 25 '17 at 8:39
0

How can I support 5000 concurrent requests with mpm_prefork on Apache?

You probably don't.

The prefork MPM is a bad choice for a site that has to handle many simultaneous connections. It uses multiple child processes with one thread each. Each process handles one connection at a time.

For 5000 concurrent connections, you'll need to run 5000 httpd processes...
You will need to check how much memory each httpd process consumes for your configuration, but even with a modest 10 MB per process and not running anything else you will run out of your 16 GB of RAM well before you hit 5000 httpd processes.

  • 1
    your answer is appreciable...Will you do one more favor for me..What should I use instead of prefork MPM. Is there any other best choice??? – harshu9713 Oct 25 '17 at 9:32
  • Please see this Q&A – HBruijn Oct 25 '17 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.