Apache MPM worker vs prefork

find what MPM Apache is using, it will either be using "worker" or "prefork"

apachectl -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c


In my case it is "prefork"

vi /etc/httpd/conf/httpd.conf

Find the section that looks like this (by default one will normally exist for prefork and for worker, but in my case I only care about prefork since prefork is what is compiled in):

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves

StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 2000
MaxClients 5000
MaxRequestsPerChild 4000


As some have mentioned the MPM prefork/worker sections are VERY important they affect both stability and performance.
In my case I'm the most concerned because I keep getting the MaxClients error message/hung Apache process without error (where Apache thinks it's running but can't connect and yet most of the time nothing in the debug log shows a problem).

Enable Debug:

Speaking of that you might want to enable this for debugging if you're having the issues I've seen (the crash but even with debug it often won't show the true error)

Add this to your config file: Loglevel debug

Back to the issue, prefork means a new process/server is started for each new connection to the web server.

My new settings:


StartServers 200
MinSpareServers 50
MaxSpareServers 200
ServerLimit 400
MaxClients 1000
MaxRequestsPerChild 0



WARNING: MaxClients of 1000 exceeds ServerLimit value of 400 servers,
lowering MaxClients to 400. To increase, please see the ServerLimit
directive.

Change ServerLimit to "4000" and restart


Tags:

apache, mpm, vs, preforkfind, quot, prefork, apachectl, compiled, modules, http_core, mod_so, vi, etc, httpd, conf, default, startservers, server, processes, minspareservers, maxspareservers, maximum, serverlimit, maxclients, maxrequestsperchild, requests, serves, ifmodule, sections, stability, debug, enable, debugging, ve, config, loglevel, settings, exceeds, servers, lowering, directive, restart,

Latest Articles

  • ImageMagick Convert PDF Not Authorized
  • ImageMagick Converted PDF to JPEG some files have a black background solution
  • Linux Mint Mate Customize the Lock screen messages and hide username and real name
  • Ubuntu/Gnome/Mint/Centos How To Take a partial screenshot
  • ssh how to verify your host key / avoid MIM attacks
  • Cisco IP Phone CP-8845 8800/8900 Series How To Reset To Factory Settings Instructions
  • ls how to list ONLY directories
  • How to encrypt your SSH private key file id_rsa
  • Linux Mint 18 Disable User Name List from showing on Login Screen
  • Firefox Cannot Hit Enter Key In Address Bar and Location History Not Working
  • Cisco Unified Communications Manager / CUCM IP 8.6,10,12 Install Error Solution
  • Ubuntu Debian Mint Linux SSHD OpenSSH Server Not Starting After Reboot Solution
  • nmap how to scan for all ports and not just the 1000 most common ports
  • Windows 7,8,10 and Server 2008, 2012, 2016, 2019 Read Only Attribute Won't Go Away
  • bind / named how to make a wildcard record and retain defined A records
  • Cisco Unified Communications Manager 12 Install Errors on Proxmox/KVM
  • Local Vs Universally Administered MAC Address NIC Refuses to come up
  • Cisco Unified Communications Manager 12 CUCM 12 - How To Enable Video Calling
  • Windows 7, 8, 10, Windows Server 2008, 2012, 2016, 2019 How To AC97 Audio Drivers and Other Unsigned Drivers
  • Cisco Unified Communications Manager / CUCM IP Telephony Definitions