Apache ThreadsPerChild and MaxRequestsPerChild configuration analysis

  
                  

Code is as follows

<IfModule mpm_winnt.c> ThreadsPerChild 1024 MaxRequestsPerChild 10000 </IfModule>

First look at two references

MaxRequestsPerChild a single child process in it The total number of requests processed during the life cycle. When the total number of requests processed by a child process reaches this limit, the process is recycled. If it is set to 0, the process will never expire (so if there is a memory leak) It will always leak out ……) ThreadsPerChild The default number of service threads per child process is 25

The best configuration method for my machine is as follows

) I want to change the size of MaxClient to more than 256. In the online forum, it is OK to increase the serverlimit line.

The code is as follows <IfModule prefork.c> ServerLimit 2000 StartServers 10 MinSpareServers 10 MaxSpareServers 15 MaxClients 1500 MaxRequestsPerChild 10000 </IfModule>

Summary

You need to calculate how much memory each httpd request takes up, remove the system and other programs. After the memory used, estimate how many requests per second, you can calculate out

Copyright © Windows knowledge All Rights Reserved