Skip to main content
InterviewHubPRO
Section Overview
Q39

Question 39 of 50

Part 3: Production Tuning, Asynchronous Workers & High Scale (25 - 35)

78%
PHP & Zend Engine (50 Qs)•Part 3: Production Tuning, Asynchronous Workers & High Scale (25 - 35)

PHP-FPM (FastCGI Process Manager) Architecture and Tuning.

senior LevelAsync & PromisesSystem Design

In Simple Words: PHP-FPM runs a master process that manages worker pools to execute PHP scripts:

  • Share-Nothing Architecture: Each HTTP request is handled by an isolated worker process. When the request finishes, the entire request memory is wiped clean, preventing memory leaks between requests.
  • Process Manager Modes:
    • static: Fixed number of workers running continuously. Maximum performance for dedicated web servers.
    • dynamic: Scales workers between pm.min_spare_servers and pm.max_children based on traffic.
    • ondemand: Spawns workers only when requests arrive (ideal for low-traffic shared hosting).