php-fpm简介
What is PHP-FPM?
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.
These features include:
- Adaptive process spawning (NEW!)
- Basic statistics (ala Apache's mod_status) (NEW!)
- Advanced process management with graceful stop/start
- Ability to start workers with different uid/gid/chroot/environment and different php.ini (replaces safe_mode)
- Stdout & stderr logging
- Emergency restart in case of accidental opcode cache destruction
- Accelerated upload support
- Support for a "slowlog"
- Enhancements to FastCGI, such as fastcgi_finish_request() - a special function to finish request & flush all data while continuing to do something time-consuming (video converting, stats processing, etc.)
It was not designed with virtual hosting in mind (large amounts of pools) however it can be adapted for any usage model.
Why PHP-FPM?
PHP-FPM not only makes configuration of FastCGI pools, but also enhances some of the FastCGI internals and increases error reporting, script terminiation, etc.
This table has a simple comparison between the most popular methods of managing FastCGI pools.
| Description | PHP "out of the box" | spawn-fcgi + spawn-php.sh + daemontools | PHP-FPM |
|---|---|---|---|
| PHP daemonization: pid file, log file, setsid(), setuid(), setgid(), chroot() | (-) | (+) | (+) |
| Process Management. Ability to "gracefully" stop and start PHP workers without losing any queries. This allows gradually updating the configuration and binary without losing any queries. | php4 (-), php5 (only graceful completion) | (-) | (+) |
| Restricting IP addresses from which requests can come from | php4 (-), php5 (+) (since 5.2.2) | (-) | (+) |
| Dynamic number of processes, depending on the load (adaptive process spawning) | (-) | (-) | in SVN, PHP 5.3.3RC1+ |
| Starting the workers with different uid/gid/chroot/environment and different php.ini options. (No need for safe mode.) | (-) | (-) | (+) |
| Logging stdout and stderr | (-) | (-) | (+) |
| Ability to emergency restart all the processes in the event of an accidental destruction of the shared memory opcode cache, if using an accelerator | (-) | (-) | (+) |
| Forcing the completion of process if set_time_limit() fails | (-) | (-) | (+) |
| Features | |||
| Error Header | (+) | ||
| Accelerated Upload Support | (+) | ||
| fastcgi_finish_request() | (+) | ||
| Slowlog (with backtrace) | (+) | ||
History
Andrei Nigmatulin is the original author of PHP-FPM. Since 2004, he waited for someone else to make PHP FastCGI production-ready, but he couldn't wait any longer. PHP-FPM is the product of the knowledge, experience and ideas from working with PHP's FastCGI SAPI on several projects.
Since that time, it has evolved into a stable, simple solution to an annoying problem that has not been addressed properly. In mid-2009, Andrei changed the format of PHP-FPM to be more modular, and no longer be a patch that had to be applied against PHP. The source code has been split up from one large patch to a normal set of files. Michael Shadle volunteered to take over the project and work on growing it into a more robust solution. There were a couple major features Andrei was never able to finish, and we're hoping to address those soon - the most important one is adaptive process spawning.
Currently, we're working on making sure that it can be packaged in distributions, the website is clean, consistent and easy to use, and the information is relevant, concise and up to date.
It has recently been brought in to PHP core, thanks to Antony Dovgal, with interim support from Dreamcat4 and continued work from Jérôme Loyet. Andrei's original vision is finally starting to become complete.
Real-world Usage
PHP-FPM serves up millions of PHP requests without an issue for hundreds of websites, with more growing each day. At Open Source Bridge in Portland, Rasmus mentioned he now uses nginx + PHP-FPM at wepay.com, the company he works for. It doesn't get more ratified than that!
License
PHP-FPM is available for public use and licensed under the GPL. The modified version of libevent, which is bundled with PHP-FPM, is distributed under a the BSD license.
转自 https://php-fpm.org/
php-fpm简介的更多相关文章
- FPM简介(定制rpm包)
FPM简介 fpm是生成rpm包的工具.rpm包的制作,采用fpm工具完成,FPM非常易用,此命令可以把rpm包的安装.卸载做得更加优雅,在安装前可以做一些准备工作,安装后可以做一些收尾工作,在卸载前 ...
- fpm来制作rpm包
转自 http://blog.halfss.com/blog/2013/02/26/fpmbao-guan-li/ 另查看 http://my.oschina.net/lxcong/blog/1438 ...
- nginx简介与配置
nginx简介 nginx(发音同engine x)是一款轻量级的Web服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like协议下发行. nginx由俄罗斯的程序 ...
- LAMP简介与部署
lamp简介 lamp,是由Linux+Apache+Mysql/MariaDB+Php/Perl/Python的一组动态网站或者服务器的开源软件,除Linux外其它各部件本身都是各自独立的程序,但是 ...
- ASP.NET Core 1.1 简介
ASP.NET Core 1.1 于2016年11月16日发布.这个版本包括许多伟大的新功能以及许多错误修复和一般的增强.这个版本包含了多个新的中间件组件.针对Windows的WebListener服 ...
- MVVM模式和在WPF中的实现(一)MVVM模式简介
MVVM模式解析和在WPF中的实现(一) MVVM模式简介 系列目录: MVVM模式解析和在WPF中的实现(一)MVVM模式简介 MVVM模式解析和在WPF中的实现(二)数据绑定 MVVM模式解析和在 ...
- Cassandra简介
在前面的一篇文章<图形数据库Neo4J简介>中,我们介绍了一种非常流行的图形数据库Neo4J的使用方法.而在本文中,我们将对另外一种类型的NoSQL数据库——Cassandra进行简单地介 ...
- REST简介
一说到REST,我想大家的第一反应就是“啊,就是那种前后台通信方式.”但是在要求详细讲述它所提出的各个约束,以及如何开始搭建REST服务时,却很少有人能够清晰地说出它到底是什么,需要遵守什么样的准则. ...
- Microservice架构模式简介
在2014年,Sam Newman,Martin Fowler在ThoughtWorks的一位同事,出版了一本新书<Building Microservices>.该书描述了如何按照Mic ...
- const,static,extern 简介
const,static,extern 简介 一.const与宏的区别: const简介:之前常用的字符串常量,一般是抽成宏,但是苹果不推荐我们抽成宏,推荐我们使用const常量. 执行时刻:宏是预编 ...
随机推荐
- openshift harp.js heroku react-router 4
https://segmentfault.com/a/1190000000355181 http://harpjs.com/ https://www.jianshu.com/p/7bc34e56fa3 ...
- php新手第一次安装mongo
以下是我走位php新手第一次安装mongo模块的步骤: 1.首先从在网上选取适当版本的mongoDB扩展包下载; 2.解压扩展包,并且进入解压目录; tar -zxf mongo-1.4.1.tgz ...
- English trip -- Iris老师整理的一般时态
一般疑问句: 用Yes/No 就能回答的问句. a.g Are you an office worker? 问句 < ...
- 4-4 集成测试练习,和测试基础知识(guide)。
Guide指南 18章应用测试指南(简单学习了一下.) (中文版--主要是为了先理解,之前看过英文版受语言影响,怕理解有偏差.) Minitest::Test是ActiveSupport::TestC ...
- Android Studio使用Gradle引入包
方法一 jar包直接复制到lib中右击add as library,等自动构建完成后,打开build.gradle会发现dependencies中多了一个compile file('libs/***. ...
- Ultimate Weirdness of an Array CodeForces - 671C (gcd,线段树)
大意: 定义一个数列的特征值为两个数gcd的最大值, $f(l,r)$表示数列删除区间$[l,r]$的元素后剩余元素的特征值, 求$\sum_{i=1}^n\sum_{j=i}^n{f(i,j)}$ ...
- 『Kaggle』Sklearn中几种分类器的调用&词袋建立
几种分类器的基本调用方法 本节的目的是基本的使用这些工具,达到熟悉sklearn的流程而已,既不会设计超参数的选择原理(后面会进行介绍),也不会介绍数学原理(应该不会涉及了,打公式超麻烦,而且近期也没 ...
- UVA-10118 Free Candies (DP、记忆化搜索)
题目大意:有4堆糖果,每堆有n个,有一只最多能容5个糖果的篮子.现在,要把糖果放到篮子里,如果篮子中有相同颜色的糖果,放的人就可以拿到自己的口袋.如果放的人足够聪明,问他最多能得到多少对糖果. 题目分 ...
- 计时(.NET)
using System.Diagnostics; // 开始计时 Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // 要计时的操 ...
- memory prefix retro,re out 2
1● retro retr əu 向后,倒退 2● re 重新,一再, 不,反向后