If an Apache website works again immediately after a restart, the restart has usually cleared exhausted, stuck, or unhealthy child processes. It is a recovery action, not a diagnosis. The durable fix comes from identifying whether Apache reached its concurrent-request limit, ran into memory pressure, kept workers occupied on slow requests, or failed to reload cleanly.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
Capture evidence during the outage before restarting. The error log, active process generations, memory state, listening sockets, and a local test request usually distinguish a capacity problem from an application, configuration, or operating-system failure.
As an Amazon Associate I earn from qualifying purchases.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11What a restart actually changes
Apache has a parent process and, depending on its multi-processing module (MPM), child processes and worker threads. Those workers accept connections, run modules, wait for upstream applications, send responses, and then become available again. When the site stops responding, the parent may still be running while every usable worker is busy, stuck, or part of an unhealthy process generation.
A restart replaces that runtime state and makes the parent read its configuration and reopen log files. A graceful restart sends the equivalent of the USR1 signal: existing children are told to finish their current requests and exit, while new children serve new requests. A non-graceful stop/start terminates the old generation and starts a new one. Either can make the site appear fixed because workers are available again, but neither proves why they became unavailable.
#1 Best Overall
- Used Book in Good Condition
Graceful recovery can be deceptive. A child holding a long-lived connection may remain for a considerable time, and repeated graceful restarts can leave several generations visible at once. Check the error log and process list rather than assuming each successful command removed the underlying condition.
The main reasons Apache stops serving requests
1. MaxRequestWorkers has been reached
Apache defines MaxRequestWorkers as the maximum number of simultaneous requests it will serve. Additional connections normally wait until a worker is free. In the prefork MPM, the value is the maximum number of child processes. In worker and event MPMs, it limits the total number of worker threads.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsWhen all workers are busy, users may see timeouts, very slow page loads, or intermittent success. A restart creates an idle pool, so traffic works until concurrency rises again. Look for error-log messages saying that the server reached the configured worker limit, and compare the time of those messages with the first failed requests.
2. The configured capacity does not fit available memory
More workers are not automatically better. Apache’s prefork guidance requires enough processes for expected concurrency while reserving physical RAM for the operating system, Apache’s parent, loaded modules, PHP or another application runtime, databases, caches, and monitoring agents. If each child is large, a seemingly reasonable process count can force swapping or trigger the operating system’s out-of-memory killer.
Memory pressure makes every request slower, which keeps workers occupied longer and can turn a moderate traffic burst into a worker-exhaustion incident. Symptoms include swap growth, high I/O wait, killed children, failed starts, or a service that becomes responsive only after old processes are removed.
3. Workers are occupied by requests that do not finish
Slow database queries, dead upstream connections, blocked file operations, WebSockets, long downloads, and module or application bugs can hold processes or threads indefinitely. Apache then has fewer workers for ordinary page requests even when traffic is not unusually high.
Proxy timeouts matter here. A front-end request waiting on an application server still consumes Apache capacity. If the upstream never closes the connection, raising MaxRequestWorkers only postpones exhaustion and may increase memory use. Identify the slow dependency and set timeouts appropriate to the application rather than using restarts as a timer.
4. A graceful restart leaves an old generation stuck
During a graceful restart, children finish their current request before exiting. That preserves in-flight work, but a child waiting on a broken upstream or persistent connection may not finish. The parent can continue creating new children while the old generation remains, consuming process and memory limits.
List Apache processes with their parent IDs, start times, elapsed times, and resident memory. Multiple generations, very old children, or a small set of processes with unusually long elapsed times point to work that is not returning normally.
5. The restart itself fails
A configuration syntax error prevents Apache from starting with the new configuration. A failed bind can also leave it unable to listen on port 80 or 443, for example when another process already owns the socket. Permission errors, missing certificates, invalid module directives, and include-file mistakes produce similar symptoms.
Always test the configuration before restarting. A restart command that returns quickly is not proof that the service is listening; verify the service-manager state and the listening sockets afterward.
6. MPM settings do not match the workload
The event, worker, and prefork MPMs use different process and thread models. In worker-style MPMs, ThreadsPerChild, MaxRequestWorkers, and ServerLimit must describe a coherent number of processes and threads. Values above what the operating system can support can prevent startup or destabilize the server.
Rank #4
| MPM | What consumes the limit | Settings to inspect | Typical investigative clue |
|---|---|---|---|
| prefork | One request-serving child process per concurrent request | MaxRequestWorkers, process size, PHP or other in-process modules, timeouts |
High resident memory per child, swapping, or too few processes for demand |
| worker | Worker threads distributed among child processes | ThreadsPerChild, MaxRequestWorkers, ServerLimit |
Thread capacity is exhausted or the process/thread relationship is invalid |
| event | Worker threads for active requests, with more efficient handling of many idle keep-alive connections | ThreadsPerChild, MaxRequestWorkers, ServerLimit, proxy and keep-alive timeouts |
Active requests, not merely idle connections, consume the available workers |
The prefork MaxRequestWorkers default is documented as 256 in Apache’s configuration guidance, but defaults are version- and MPM-specific. Treat that number as a software default, not a safe recommendation for every machine.
What to collect during the next outage
Run these checks before restarting if the host is still reachable. Substitute your distribution’s service name and log paths; Debian-based systems commonly use apache2 and /var/log/apache2/, while other systems commonly use httpd and /var/log/httpd/.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →- Save the recent error log. Use
sudo tail -n 200 /var/log/apache2/error.logor the equivalent path. Preserve timestamps and the complete messages, not just a screenshot. - Save the access-log tail. Run
sudo tail -n 100 /var/log/apache2/access.log. Look for requests whose start times have no corresponding completion, repeated slow endpoints, or a sudden change in status codes. - Check the service manager. Run
sudo systemctl status apache2orsudo systemctl status httpd. Record the main PID, recent exit reason, and any restart-loop message. - Inspect process generations. Run
ps -eo user,pid,ppid,stat,rss,etime,cmd | grep -E '[a]pache2|[h]ttpd'. Compare parent IDs, start times, states, and resident memory. - Measure memory and swap. Record
free -h,vmstat 1 5, and, where available, the kernel log for out-of-memory kills. A full swap device or rapidly rising swap-in activity changes the correct fix. - Verify listening sockets. Run
sudo ss -ltnp | grep -E ':(80|443)b'. If no Apache process owns the expected port, the problem is startup, binding, or another service—not merely a busy scoreboard. - Test locally. Run
curl -sv --max-time 10 http://127.0.0.1/and, for TLS virtual hosting,curl -skv --max-time 10 https://127.0.0.1/ -H 'Host: example.test'. A local failure removes the external network and load balancer from the first layer of investigation. - Record the active MPM and limits. Use your distribution’s module listing command, such as
apachectl -M, and inspect the loaded configuration forMaxRequestWorkers,ThreadsPerChild,ServerLimit, keep-alive settings, and proxy timeouts.
If the host is so overloaded that collecting evidence threatens recovery, save at least the error log, service status, memory state, and process list, then proceed to a controlled recovery.
Validate configuration before attempting recovery
- Run
sudo apachectl configtest. Some distributions provide the same check throughapache2ctl configtestor a service-specific command. - Fix every reported syntax, include-file, module, permission, certificate, and name-resolution error. Do not treat a warning as harmless until you understand which directive produced it.
- Run the test again until it reports a valid configuration.
- Check whether ports are already occupied with
sudo ss -ltnp | grep -E ':(80|443)b'. Resolve a competing listener before restarting Apache.
If the test fails, do not repeatedly issue restart commands. Each attempt can obscure the original error in the service log and cannot produce a healthy listener from invalid configuration.
Best Value
Choose the least disruptive restart
| Action | Effect | Use when | Risk or limitation |
|---|---|---|---|
| Graceful restart | Parent re-reads configuration and logs; children finish current requests before exiting | Configuration is valid and preserving in-flight requests is important | Stuck or long-lived children can remain; old generations may accumulate |
| Controlled stop/start | Stops the old process set and starts a fresh one | Workers are wedged, memory is exhausted, or graceful children will not leave | Active requests are interrupted and a startup error causes full downtime |
Apache recommends using apachectl or the operating system’s init/service script for start, stop, and restart operations. After either action, verify systemctl is-active apache2 (or httpd), confirm ports 80 and 443 are listening, and repeat the localhost request. A successful command without a successful request is not recovery.
Fix the underlying cause instead of raising limits blindly
When concurrency is genuinely too high
Measure the peak number of active requests and the duration distribution of those requests. Increase capacity only if physical RAM remains available at the peak and the application, database, and upstream services can handle the added concurrency. In prefork, estimate the memory budget from the resident size of real children, not the parent process alone; reserve memory for the operating system and every other service.
In worker or event, make the values mathematically consistent: the maximum number of worker threads must be supportable by the configured child-process and thread limits. Change one related setting at a time, run apachectl configtest, reload during a maintenance-safe window, and observe memory, latency, and busy-worker counts.
When memory is the bottleneck
- Lower the process or thread ceiling to a value the machine can sustain without swapping.
- Reduce per-request memory in the application and disable unnecessary in-process modules.
- Move expensive work to an appropriate application service so Apache workers are not carrying it indefinitely.
- Increase physical memory or move workloads apart when measured demand cannot fit the host.
Do not use swap as a substitute for a capacity plan. Swapping can keep a process alive while making every request slow enough to consume even more workers.
When requests or upstreams are stuck
- Find the URL, application operation, database query, or upstream host associated with long request times.
- Set connect, read, and overall proxy timeouts that reflect a valid transaction’s maximum duration.
- Check connection pools, database locks, DNS resolution, and upstream health at the same timestamps as Apache’s busy-worker messages.
- Handle WebSockets and other intentionally long-lived connections separately; do not size ordinary page capacity as if those connections were short requests.
When graceful generations do not exit
Identify the oldest generation and the requests it is serving from the error and access logs. If it is safe to interrupt those connections, perform a controlled stop/start after validating configuration. Then fix the module, upstream, or timeout that prevented completion; otherwise the next graceful restart will reproduce the condition.
When startup or binding fails
Correct the exact configuration or port-ownership error first. Check certificate paths and permissions, included virtual-host files, loaded modules, and whether another process is listening on 80 or 443. Restart only after configtest passes, then verify the listener and a local HTTP request.
Recommended Free Tools
How to read the evidence
| Evidence | Most likely direction | Next check |
|---|---|---|
Error log reports reaching MaxRequestWorkers |
Concurrent capacity is exhausted | Compare busy workers, request durations, peak traffic, and memory headroom |
| High swap, killed children, or allocation failures | Configured capacity exceeds physical memory | Measure per-child or per-process memory and reduce sustainable concurrency |
| Very old children or multiple graceful generations | Requests, upstreams, or modules are not returning | Correlate process elapsed time with URLs and upstream timeout logs |
configtest fails |
Reload or restart cannot produce a valid server | Fix the first syntax, include, certificate, or permission error |
| No listener on 80/443 or another PID owns it | Startup or bind problem | Inspect the competing service and service-manager journal |
| Local curl fails while Apache appears active | Apache, its virtual host, or its upstream path is failing locally | Read the matching error-log timestamps and test the upstream directly |
Prevent the outage from recurring
- Alert before the limit is reached on busy workers, queued requests, memory, swap, and child-process churn.
- Alert on error-log messages indicating that
MaxRequestWorkerswas reached, repeated child exits, bind failures, and configuration errors. - Track request duration, upstream connection duration, peak concurrency, per-process memory, and restart frequency together. Any one metric without the others can mislead capacity decisions.
- Keep Apache, its MPM, proxy modules, TLS configuration, and application runtime maintained and compatible.
- Separate slow or unreliable upstream dependencies from ordinary page traffic and set explicit timeouts.
- Document the active MPM and the reason for each capacity value so a future change does not silently invalidate the process/thread relationship.
- Use restarts as an emergency recovery procedure, not as routine monitoring. A scheduled restart can hide a leak or stuck dependency while allowing the same failure to return.
The correct long-term setting depends on the active MPM, peak concurrency, request and upstream duration, per-worker memory, available RAM and swap, and whether long-lived connections are expected. Those measurements determine whether to tune limits, fix application latency, change restart behavior, or correct configuration.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




