TEXT   22

APACHE.txt

Guest on 31st May 2021 10:18:34 PM

  1. COMMENTS ON THE CONFIGURATION OF APACHE FOR LARGE SITES
  2. -----------------------------------------------------
  3. (File last updated on 25/October)
  4.  
  5. If you have a large site, for instance with more than 50 teams, then
  6. the best practice is to decrease the number of threads/servers that
  7. apache starts (yes, I said to DECREASE). The problem is that the computers
  8. are not so powerful, and apache is usually configured with too many of them.
  9. If there are too many requests, instead of queuing them, apache tries to
  10. answer all in parallel, and the server suffers a lot. This can be changed in the
  11. /etc/apache2/apache.conf file, as below (well, the exact values to use
  12. depend on your site, the original config has too high numbers):
  13.  
  14.  
  15. # prefork MPM
  16. # StartServers: number of server processes to start
  17. # MinSpareServers: minimum number of server processes which are kept spare
  18. # MaxSpareServers: maximum number of server processes which are kept spare
  19. # MaxClients: maximum number of server processes allowed to start
  20. # MaxRequestsPerChild: maximum number of requests a server process serves
  21. <IfModule mpm_prefork_module>
  22.     StartServers          3
  23.     MinSpareServers       3
  24.     MaxSpareServers      6
  25.     MaxClients          40
  26.     MaxRequestsPerChild   0
  27. </IfModule>
  28.  
  29. # worker MPM
  30. # StartServers: initial number of server processes to start
  31. # MinSpareThreads: minimum number of worker threads which are kept spare
  32. # MaxSpareThreads: maximum number of worker threads which are kept spare
  33. # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
  34. #              graceful restart. ThreadLimit can only be changed by stopping
  35. #              and starting Apache.
  36. # ThreadsPerChild: constant number of worker threads in each server process
  37. # MaxClients: maximum number of simultaneous client connections
  38. # MaxRequestsPerChild: maximum number of requests a server process serves
  39. <IfModule mpm_worker_module>
  40.     StartServers          2
  41.     MinSpareThreads      10
  42.     MaxSpareThreads      30
  43.     ThreadLimit          32
  44.     ThreadsPerChild      10
  45.     MaxClients          40
  46.     MaxRequestsPerChild   0
  47. </IfModule>
  48.  
  49. # event MPM
  50. # StartServers: initial number of server processes to start
  51. # MinSpareThreads: minimum number of worker threads which are kept spare
  52. # MaxSpareThreads: maximum number of worker threads which are kept spare
  53. # ThreadsPerChild: constant number of worker threads in each server process
  54. # MaxClients: maximum number of simultaneous client connections
  55. # MaxRequestsPerChild: maximum number of requests a server process serves
  56. <IfModule mpm_event_module>
  57.     StartServers          2
  58.     MinSpareThreads      10
  59.     MaxSpareThreads      30
  60.     ThreadLimit          32
  61.     ThreadsPerChild      10
  62.     MaxClients          40
  63.     MaxRequestsPerChild   0
  64. </IfModule>
  65.  
  66.  
  67.  
  68. Contacts and Copyrights
  69. -----------------------
  70. BOCA Copyright (c) 2003- Cassio Polpo de Campos (cassio@ime.usp.br)
  71. http://www.ime.usp.br/~cassio/boca
  72.  
  73. ////////////////////////////////////////////////////////////////////////////////
  74. //BOCA Online Contest Administrator
  75. //    Copyright (C) 2003-2012 by BOCA Development Team (bocasystem@gmail.com)
  76. //
  77. //    This program is free software: you can redistribute it and/or modify
  78. //    it under the terms of the GNU General Public License as published by
  79. //    the Free Software Foundation, either version 3 of the License, or
  80. //    (at your option) any later version.
  81. //
  82. //    This program is distributed in the hope that it will be useful,
  83. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  84. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  85. //    GNU General Public License for more details.
  86. //    You should have received a copy of the GNU General Public License
  87. //    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  88. ////////////////////////////////////////////////////////////////////////////////

Raw Paste


Login or Register to edit or fork this paste. It's free.