Modify apache concurrency in windows

Source: Internet
Author: User

 

Modify the maximum number of connections of apache as follows:

 

Step 1

First modify the/path/apache/conf/httpd. conf file.

# Vi httpd. conf

Remove "#" before "# Include conf/extra/httpd-mpm.conf" and save it.

 

Step 2

Modify the/path/apache/conf/extra/httpd-mpm.conf file.

# Vi httpd-mpm.conf

Find this line

 

Original:

 

StartServers 5

MinSpareServers 5

MaxSpareServers 10

MaxClients 150

MaxRequestsPerChild 0

 

After modification

 

ServerLimit 1000 # maximum concurrency

StartServers 10 # default number of startup threads

MinSpareServers 5

MaxSpareServers 15

MaxClients 1000 # requests simultaneously processed by apache

ThreadsPerChild 250 # Number of threads for each process. After these threads are created at startup, a new thread is no longer created. The default value is 64 and the maximum value is 1920.

MaxRequestsPerChild 5000 # The default value 0 is not recommended in the official reference manual. It is mainly based on two considerations: (1) it can prevent (accidental) infinite Memory leakage and thus consume the memory; (2) give the process a limited life, # This helps reduce the number of active processes when the server load is reduced.

 

 

 

Note:

ServerLimit this command must be placed in the first line.

 

 

After modification, you must stop apachectl restart first and then start apachectl.

 

Certificate ---------------------------------------------------------------------------------------------------------------------------------------

 

If you follow the above steps, you will find that there is no effect (at least I do), because in win2003, mpm_prefork_module is not used, but mpm_winnt_module, serverLimit 1000 is invalid in mpm_winnt_module. After looking for an afternoon, I couldn't find a way to increase the apahce concurrency in the window. I guess the maximum number of concurrent connections may be the maximum number of connections on the server?

 

2011-8-27

 

Today I have pondered again, or modify conf/extra/httpd-mpm.conf file, since in windows is mpm_winnt_module, then modify this try

 

My default is

 

<IfModule mpm_winnt_module>

ThreadsPerChild 150

MaxRequestsPerChild 0

</IfModule>

 

The concurrency of the AB test is about 250.

 

Try to modify

 

ThreadsPerChild 250

MaxRequestsPerChild 5000

 

The AB test may not work in more than 300 cases. Modifications to ThreadsPerChild are still effective.

 

It seems that the maximum number of concurrent threads is about 1.5 times that of ThreadsPerChild (you can try it)

 

 

From leiyonglin's blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.