Advertisement
myapit

Apache worker config

Nov 24th, 2020
1,288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Concurrent Connections
  2. By default apache2 is configured to support 150 concurrent connections. This forces all parallel requests beyond that limit to wait. Especially if, for example, active sync clients maintain a permanent connection for push events to arrive.
  3.  
  4. This is an example configuration to provide 8000 concurrent connections.
  5.  
  6. <IfModule mpm_worker_module>
  7.     ServerLimit              250
  8.     StartServers              10
  9.     MinSpareThreads           75
  10.     MaxSpareThreads          250
  11.     ThreadLimit               64
  12.     ThreadsPerChild           32
  13.     MaxRequestWorkers       8000
  14.     MaxConnectionsPerChild 10000
  15. </IfModule>
  16. Note: MaxRequestWorkers was previously named MaxClients and MaxConnectionsPerChild was previously named MaxRequestsPerChild. If you are using old (pre 2.4) verions of apache you might need to use the old names.
  17.  
  18. Short explanation of the parameters:
  19.  
  20. ServerLimit -   Declares the maximum number of running apache processes. If you change this value you have to restart the daemon.
  21. StartServers -  The number of processes to start initially when starting the apache daemon.
  22.  
  23. MinSpareThreads/MaxSpareThreads  - This regulates how many threads may stay idle without being killed. Apache regulates this on its own very well with default values.
  24.  
  25. ThreadsPerChild - How many threads can be created per process. Can be changed during a reload.
  26. ThreadLimit ThreadsPerChild can be configured as high as this value during runtime. If you change this value you have to restart the daemon.
  27.  
  28. MaxRequestWorkers   - This declares how many concurrent connections we provide. Devided by ThreadsPerChild you get the suitable ServerLimit value. May be less than ServerLimit * ThreadsPerChild to reserve some resources that can be engaged during runtime with increasing MaxRequestWorkers and reloading the configuration.
  29.  
  30. MaxConnectionsPerChild  - Defines the number of Connections that a process can handle during its lifetime (keep-alives are counted once). After that it will be killed. This can be used to prevent possible apache memory leaks. If set to 0 the lifetime is infinite.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement