CGI

FastCGI

FPM

FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features (mostly) useful for heavy-loaded sites.

功能特性列表

  1. advanced process management with graceful stop/start;
  2. ability to start workers with different uid/gid/chroot/environment, listening on different ports and using different php.ini (replaces safe_mode);
  3. stdout and stderr logging;
  4. emergency restart in case of accidental opcode cache destruction;
  5. accelerated upload support;
  6. "slowlog" - logging scripts (not just their names, but their PHP backtraces too, using ptrace and similar things to read remote process' execute_data) that are executed unusually slow;
  7. fastcgi_finish_request() - special function to finish request and flush all data while continuing to do something time-consuming (video converting, stats processing etc.);
  8. dynamic/static child spawning;
  9. basic SAPI status info (similar to Apache mod_status);
  10. php.ini-based config file.

php-fpm支持两种进程管理模型

  • static
  • dynamic (php-fpm 5.3之前版本称为apache-like风格,从php-fpm 5.3版本开始实现该模型)

Apache mod_php

延伸阅读

返回顶部