Apache · Configuration and operations

What is a graceful restart and when should you use it?

Easygraceful restartreloadoperationsUpdated Oct 2026
Quiz this track

Short answer

A graceful restart reloads configuration and replaces workers while letting in-flight requests finish. Use it for configuration and certificate changes; use a full restart only when the process or its environment must change.

Apache's graceful restart signals the parent to start new children with the new configuration. Old children stop accepting new connections and exit after their current requests complete. Clients should not see dropped connections, although long-lived connections may keep old workers alive for a while.

bash
apachectl configtest
apachectl graceful
systemctl reload apache2
systemctl status apache2

apachectl graceful-stop
apachectl -k restart

What it does and does not do

  • Applies new configuration and reloads certificates
  • Keeps the parent process and listening sockets
  • Lets old workers finish active requests before exiting
  • Does not change environment variables or the binary
  • Does not fix a corrupted module or a leaked file descriptor in the parent
  • May leave old workers around if a request hangs, so monitor process age

Always run configtest first. A graceful restart with an invalid configuration may fail to spawn new workers while old ones continue, leaving you in a confusing partial state. For a new Apache binary or a changed systemd unit, use a full restart with a drain window.

Under heavy long-lived traffic, a graceful restart can accumulate old workers. Check the process list and logs after the reload, especially if HTTP/2 or WebSocket connections are common.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What signal does a graceful restart send?
  2. 2How does graceful differ from graceful-stop?
  3. 3When must you use a full restart instead?
  4. 4How do you verify that reloads are not leaking workers?

Say it in the interview

A graceful restart tells the parent to load new configuration and start new children while old ones drain. Existing requests finish, and the listening sockets stay open. I always run configtest first, then reload through systemd or apachectl. For a new binary or environment change I plan a full restart with a drain window.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Apache mock interview and get scored feedback on depth, clarity and confidence.