Advertisement
RedFoxy

php-fpm

Jul 19th, 2012
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.51 KB | None | 0 0
  1. ; ALL CUSTOMIZATIONS ARE AT END OF FILE!
  2. ; ALL CUSTOMIZATIONS ARE AT END OF FILE!
  3. ; ALL CUSTOMIZATIONS ARE AT END OF FILE!
  4. ;;;;;;;;;;;;;;;;;;;;;
  5. ; FPM Configuration ;
  6. ;;;;;;;;;;;;;;;;;;;;;
  7.  
  8. ; All relative paths in this configuration file are relative to PHP's install
  9. ; prefix (/usr/local). This prefix can be dynamicaly changed by using the
  10. ; '-p' argument from the command line.
  11.  
  12. ; Include one or more files. If glob(3) exists, it is used to include a bunch of
  13. ; files from a glob(3) pattern. This directive can be used everywhere in the
  14. ; file.
  15. ; Relative path can also be used. They will be prefixed by:
  16. ; - the global prefix if it's been set (-p arguement)
  17. ; - /usr/local otherwise
  18. ;include=etc/fpm.d/*.conf
  19.  
  20. ;;;;;;;;;;;;;;;;;;
  21. ; Global Options ;
  22. ;;;;;;;;;;;;;;;;;;
  23.  
  24. [global]
  25. ; Pid file
  26. ; Note: the default prefix is /var
  27. ; Default Value: none
  28. pid = run/php-fpm.pid
  29.  
  30. ; Error log file
  31. ; If it's set to "syslog", log is sent to syslogd instead of being written
  32. ; in a local file.
  33. ; Note: the default prefix is /var
  34. ; Default Value: log/php-fpm.log
  35. ;error_log = log/php-fpm.log
  36.  
  37. ; syslog_facility is used to specify what type of program is logging the
  38. ; message. This lets syslogd specify that messages from different facilities
  39. ; will be handled differently.
  40. ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
  41. ; Default Value: daemon
  42. ;syslog.facility = daemon
  43.  
  44. ; syslog_ident is prepended to every message. If you have multiple FPM
  45. ; instances running on the same server, you can change the default value
  46. ; which must suit common needs.
  47. ; Default Value: php-fpm
  48. ;syslog.ident = php-fpm
  49.  
  50. ; Log level
  51. ; Possible Values: alert, error, warning, notice, debug
  52. ; Default Value: notice
  53. ;log_level = notice
  54.  
  55. ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
  56. ; interval set by emergency_restart_interval then FPM will restart. A value
  57. ; of '0' means 'Off'.
  58. ; Default Value: 0
  59. ;emergency_restart_threshold = 0
  60.  
  61. ; Interval of time used by emergency_restart_interval to determine when
  62. ; a graceful restart will be initiated. This can be useful to work around
  63. ; accidental corruptions in an accelerator's shared memory.
  64. ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
  65. ; Default Unit: seconds
  66. ; Default Value: 0
  67. ;emergency_restart_interval = 0
  68.  
  69. ; Time limit for child processes to wait for a reaction on signals from master.
  70. ; Available units: s(econds), m(inutes), h(ours), or d(ays)
  71. ; Default Unit: seconds
  72. ; Default Value: 0
  73. ;process_control_timeout = 0
  74.  
  75. ; The maximum number of processes FPM will fork. This has been design to control
  76. ; the global number of processes when using dynamic PM within a lot of pools.
  77. ; Use it with caution.
  78. ; Note: A value of 0 indicates no limit
  79. ; Default Value: 0
  80. ; process.max = 128
  81.  
  82. ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
  83. ; Default Value: yes
  84. ;daemonize = yes
  85.  
  86. ; Set open file descriptor rlimit for the master process.
  87. ; Default Value: system defined value
  88. ;rlimit_files = 1024
  89.  
  90. ; Set max core size rlimit for the master process.
  91. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  92. ; Default Value: system defined value
  93. ;rlimit_core = 0
  94.  
  95. ; Specify the event mechanism FPM will use. The following is available:
  96. ; - select (any POSIX os)
  97. ; - poll (any POSIX os)
  98. ; - epoll (linux >= 2.5.44)
  99. ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
  100. ; - /dev/poll (Solaris >= 7)
  101. ; - port (Solaris >= 10)
  102. ; Default Value: not set (auto detection)
  103. ; events.mechanism = epoll
  104.  
  105. ;;;;;;;;;;;;;;;;;;;;
  106. ; Pool Definitions ;
  107. ;;;;;;;;;;;;;;;;;;;;
  108.  
  109. ; Multiple pools of child processes may be started with different listening
  110. ; ports and different management options. The name of the pool will be
  111. ; used in logs and stats. There is no limitation on the number of pools which
  112. ; FPM can handle. Your system will tell you anyway :)
  113.  
  114. ; Start a new pool named 'www'.
  115. ; the variable $pool can we used in any directive and will be replaced by the
  116. ; pool name ('www' here)
  117. [www]
  118.  
  119. ; Per pool prefix
  120. ; It only applies on the following directives:
  121. ; - 'slowlog'
  122. ; - 'listen' (unixsocket)
  123. ; - 'chroot'
  124. ; - 'chdir'
  125. ; - 'php_values'
  126. ; - 'php_admin_values'
  127. ; When not set, the global prefix (or /usr/local) applies instead.
  128. ; Note: This directive can also be relative to the global prefix.
  129. ; Default Value: none
  130. ;prefix = /path/to/pools/$pool
  131.  
  132. ; Unix user/group of processes
  133. ; Note: The user is mandatory. If the group is not set, the default user's group
  134. ; will be used.
  135. user = www
  136. group = www
  137.  
  138. ; The address on which to accept FastCGI requests.
  139. ; Valid syntaxes are:
  140. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
  141. ; a specific port;
  142. ; 'port' - to listen on a TCP socket to all addresses on a
  143. ; specific port;
  144. ; '/path/to/unix/socket' - to listen on a unix socket.
  145. ; Note: This value is mandatory.
  146. listen = 127.0.0.1:9000
  147.  
  148. ; Set listen(2) backlog. A value of '-1' means unlimited.
  149. ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
  150. ;listen.backlog = -1
  151.  
  152. ; Set permissions for unix socket, if one is used. In Linux, read/write
  153. ; permissions must be set in order to allow connections from a web server. Many
  154. ; BSD-derived systems allow connections regardless of permissions.
  155. ; Default Values: user and group are set as the running user
  156. ; mode is set to 0666
  157. ;listen.owner = www
  158. ;listen.group = www
  159. ;listen.mode = 0666
  160.  
  161. ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
  162. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  163. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  164. ; must be separated by a comma. If this value is left blank, connections will be
  165. ; accepted from any ip address.
  166. ; Default Value: any
  167. ;listen.allowed_clients = 127.0.0.1
  168.  
  169. ; Choose how the process manager will control the number of child processes.
  170. ; Possible Values:
  171. ; static - a fixed number (pm.max_children) of child processes;
  172. ; dynamic - the number of child processes are set dynamically based on the
  173. ; following directives. With this process management, there will be
  174. ; always at least 1 children.
  175. ; pm.max_children - the maximum number of children that can
  176. ; be alive at the same time.
  177. ; pm.start_servers - the number of children created on startup.
  178. ; pm.min_spare_servers - the minimum number of children in 'idle'
  179. ; state (waiting to process). If the number
  180. ; of 'idle' processes is less than this
  181. ; number then some children will be created.
  182. ; pm.max_spare_servers - the maximum number of children in 'idle'
  183. ; state (waiting to process). If the number
  184. ; of 'idle' processes is greater than this
  185. ; number then some children will be killed.
  186. ; ondemand - no children are created at startup. Children will be forked when
  187. ; new requests will connect. The following parameter are used:
  188. ; pm.max_children - the maximum number of children that
  189. ; can be alive at the same time.
  190. ; pm.process_idle_timeout - The number of seconds after which
  191. ; an idle process will be killed.
  192. ; Note: This value is mandatory.
  193. pm = dynamic
  194.  
  195. ; The number of child processes to be created when pm is set to 'static' and the
  196. ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
  197. ; This value sets the limit on the number of simultaneous requests that will be
  198. ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
  199. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
  200. ; CGI. The below defaults are based on a server without much resources. Don't
  201. ; forget to tweak pm.* to fit your needs.
  202. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
  203. ; Note: This value is mandatory.
  204. pm.max_children = 5
  205.  
  206. ; The number of child processes created on startup.
  207. ; Note: Used only when pm is set to 'dynamic'
  208. ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
  209. pm.start_servers = 2
  210.  
  211. ; The desired minimum number of idle server processes.
  212. ; Note: Used only when pm is set to 'dynamic'
  213. ; Note: Mandatory when pm is set to 'dynamic'
  214. pm.min_spare_servers = 1
  215.  
  216. ; The desired maximum number of idle server processes.
  217. ; Note: Used only when pm is set to 'dynamic'
  218. ; Note: Mandatory when pm is set to 'dynamic'
  219. pm.max_spare_servers = 3
  220.  
  221. ; The number of seconds after which an idle process will be killed.
  222. ; Note: Used only when pm is set to 'ondemand'
  223. ; Default Value: 10s
  224. ;pm.process_idle_timeout = 10s;
  225.  
  226. ; The number of requests each child process should execute before respawning.
  227. ; This can be useful to work around memory leaks in 3rd party libraries. For
  228. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  229. ; Default Value: 0
  230. ;pm.max_requests = 500
  231.  
  232. ; The URI to view the FPM status page. If this value is not set, no URI will be
  233. ; recognized as a status page. It shows the following informations:
  234. ; pool - the name of the pool;
  235. ; process manager - static, dynamic or ondemand;
  236. ; start time - the date and time FPM has started;
  237. ; start since - number of seconds since FPM has started;
  238. ; accepted conn - the number of request accepted by the pool;
  239. ; listen queue - the number of request in the queue of pending
  240. ; connections (see backlog in listen(2));
  241. ; max listen queue - the maximum number of requests in the queue
  242. ; of pending connections since FPM has started;
  243. ; listen queue len - the size of the socket queue of pending connections;
  244. ; idle processes - the number of idle processes;
  245. ; active processes - the number of active processes;
  246. ; total processes - the number of idle + active processes;
  247. ; max active processes - the maximum number of active processes since FPM
  248. ; has started;
  249. ; max children reached - number of times, the process limit has been reached,
  250. ; when pm tries to start more children (works only for
  251. ; pm 'dynamic' and 'ondemand');
  252. ; Value are updated in real time.
  253. ; Example output:
  254. ; pool: www
  255. ; process manager: static
  256. ; start time: 01/Jul/2011:17:53:49 +0200
  257. ; start since: 62636
  258. ; accepted conn: 190460
  259. ; listen queue: 0
  260. ; max listen queue: 1
  261. ; listen queue len: 42
  262. ; idle processes: 4
  263. ; active processes: 11
  264. ; total processes: 15
  265. ; max active processes: 12
  266. ; max children reached: 0
  267. ;
  268. ; By default the status page output is formatted as text/plain. Passing either
  269. ; 'html', 'xml' or 'json' in the query string will return the corresponding
  270. ; output syntax. Example:
  271. ; http://www.foo.bar/status
  272. ; http://www.foo.bar/status?json
  273. ; http://www.foo.bar/status?html
  274. ; http://www.foo.bar/status?xml
  275. ;
  276. ; By default the status page only outputs short status. Passing 'full' in the
  277. ; query string will also return status for each pool process.
  278. ; Example:
  279. ; http://www.foo.bar/status?full
  280. ; http://www.foo.bar/status?json&full
  281. ; http://www.foo.bar/status?html&full
  282. ; http://www.foo.bar/status?xml&full
  283. ; The Full status returns for each process:
  284. ; pid - the PID of the process;
  285. ; state - the state of the process (Idle, Running, ...);
  286. ; start time - the date and time the process has started;
  287. ; start since - the number of seconds since the process has started;
  288. ; requests - the number of requests the process has served;
  289. ; request duration - the duration in ยตs of the requests;
  290. ; request method - the request method (GET, POST, ...);
  291. ; request URI - the request URI with the query string;
  292. ; content length - the content length of the request (only with POST);
  293. ; user - the user (PHP_AUTH_USER) (or '-' if not set);
  294. ; script - the main script called (or '-' if not set);
  295. ; last request cpu - the %cpu the last request consumed
  296. ; it's always 0 if the process is not in Idle state
  297. ; because CPU calculation is done when the request
  298. ; processing has terminated;
  299. ; last request memory - the max amount of memory the last request consumed
  300. ; it's always 0 if the process is not in Idle state
  301. ; because memory calculation is done when the request
  302. ; processing has terminated;
  303. ; If the process is in Idle state, then informations are related to the
  304. ; last request the process has served. Otherwise informations are related to
  305. ; the current request being served.
  306. ; Example output:
  307. ; ************************
  308. ; pid: 31330
  309. ; state: Running
  310. ; start time: 01/Jul/2011:17:53:49 +0200
  311. ; start since: 63087
  312. ; requests: 12808
  313. ; request duration: 1250261
  314. ; request method: GET
  315. ; request URI: /test_mem.php?N=10000
  316. ; content length: 0
  317. ; user: -
  318. ; script: /home/fat/web/docs/php/test_mem.php
  319. ; last request cpu: 0.00
  320. ; last request memory: 0
  321. ;
  322. ; Note: There is a real-time FPM status monitoring sample web page available
  323. ; It's available in: ${prefix}/share/php/fpm/status.html
  324. ;
  325. ; Note: The value must start with a leading slash (/). The value can be
  326. ; anything, but it may not be a good idea to use the .php extension or it
  327. ; may conflict with a real PHP file.
  328. ; Default Value: not set
  329. ;pm.status_path = /status
  330.  
  331. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  332. ; URI will be recognized as a ping page. This could be used to test from outside
  333. ; that FPM is alive and responding, or to
  334. ; - create a graph of FPM availability (rrd or such);
  335. ; - remove a server from a group if it is not responding (load balancing);
  336. ; - trigger alerts for the operating team (24/7).
  337. ; Note: The value must start with a leading slash (/). The value can be
  338. ; anything, but it may not be a good idea to use the .php extension or it
  339. ; may conflict with a real PHP file.
  340. ; Default Value: not set
  341. ;ping.path = /ping
  342.  
  343. ; This directive may be used to customize the response of a ping request. The
  344. ; response is formatted as text/plain with a 200 response code.
  345. ; Default Value: pong
  346. ;ping.response = pong
  347.  
  348. ; The access log file
  349. ; Default: not set
  350. ;access.log = log/$pool.access.log
  351.  
  352. ; The access log format.
  353. ; The following syntax is allowed
  354. ; %%: the '%' character
  355. ; %C: %CPU used by the request
  356. ; it can accept the following format:
  357. ; - %{user}C for user CPU only
  358. ; - %{system}C for system CPU only
  359. ; - %{total}C for user + system CPU (default)
  360. ; %d: time taken to serve the request
  361. ; it can accept the following format:
  362. ; - %{seconds}d (default)
  363. ; - %{miliseconds}d
  364. ; - %{mili}d
  365. ; - %{microseconds}d
  366. ; - %{micro}d
  367. ; %e: an environment variable (same as $_ENV or $_SERVER)
  368. ; it must be associated with embraces to specify the name of the env
  369. ; variable. Some exemples:
  370. ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
  371. ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
  372. ; %f: script filename
  373. ; %l: content-length of the request (for POST request only)
  374. ; %m: request method
  375. ; %M: peak of memory allocated by PHP
  376. ; it can accept the following format:
  377. ; - %{bytes}M (default)
  378. ; - %{kilobytes}M
  379. ; - %{kilo}M
  380. ; - %{megabytes}M
  381. ; - %{mega}M
  382. ; %n: pool name
  383. ; %o: ouput header
  384. ; it must be associated with embraces to specify the name of the header:
  385. ; - %{Content-Type}o
  386. ; - %{X-Powered-By}o
  387. ; - %{Transfert-Encoding}o
  388. ; - ....
  389. ; %p: PID of the child that serviced the request
  390. ; %P: PID of the parent of the child that serviced the request
  391. ; %q: the query string
  392. ; %Q: the '?' character if query string exists
  393. ; %r: the request URI (without the query string, see %q and %Q)
  394. ; %R: remote IP address
  395. ; %s: status (response code)
  396. ; %t: server time the request was received
  397. ; it can accept a strftime(3) format:
  398. ; %d/%b/%Y:%H:%M:%S %z (default)
  399. ; %T: time the log has been written (the request has finished)
  400. ; it can accept a strftime(3) format:
  401. ; %d/%b/%Y:%H:%M:%S %z (default)
  402. ; %u: remote user
  403. ;
  404. ; Default: "%R - %u %t \"%m %r\" %s"
  405. ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
  406.  
  407. ; The log file for slow requests
  408. ; Default Value: not set
  409. ; Note: slowlog is mandatory if request_slowlog_timeout is set
  410. ;slowlog = log/$pool.log.slow
  411.  
  412. ; The timeout for serving a single request after which a PHP backtrace will be
  413. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  414. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  415. ; Default Value: 0
  416. ;request_slowlog_timeout = 0
  417.  
  418. ; The timeout for serving a single request after which the worker process will
  419. ; be killed. This option should be used when the 'max_execution_time' ini option
  420. ; does not stop script execution for some reason. A value of '0' means 'off'.
  421. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  422. ; Default Value: 0
  423. ;request_terminate_timeout = 0
  424.  
  425. ; Set open file descriptor rlimit.
  426. ; Default Value: system defined value
  427. ;rlimit_files = 1024
  428.  
  429. ; Set max core size rlimit.
  430. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  431. ; Default Value: system defined value
  432. ;rlimit_core = 0
  433.  
  434. ; Chroot to this directory at the start. This value must be defined as an
  435. ; absolute path. When this value is not set, chroot is not used.
  436. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
  437. ; of its subdirectories. If the pool prefix is not set, the global prefix
  438. ; will be used instead.
  439. ; Note: chrooting is a great security feature and should be used whenever
  440. ; possible. However, all PHP paths will be relative to the chroot
  441. ; (error_log, sessions.save_path, ...).
  442. ; Default Value: not set
  443. ;chroot =
  444.  
  445. ; Chdir to this directory at the start.
  446. ; Note: relative path can be used.
  447. ; Default Value: current directory or / when chroot
  448. ;chdir = /var/www
  449.  
  450. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  451. ; stderr will be redirected to /dev/null according to FastCGI specs.
  452. ; Note: on highloaded environement, this can cause some delay in the page
  453. ; process time (several ms).
  454. ; Default Value: no
  455. ;catch_workers_output = yes
  456.  
  457. ; Limits the extensions of the main script FPM will allow to parse. This can
  458. ; prevent configuration mistakes on the web server side. You should only limit
  459. ; FPM to .php extensions to prevent malicious users to use other extensions to
  460. ; exectute php code.
  461. ; Note: set an empty value to allow all extensions.
  462. ; Default Value: .php
  463. ;security.limit_extensions = .php .php3 .php4 .php5
  464.  
  465. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  466. ; the current environment.
  467. ; Default Value: clean env
  468. ;env[HOSTNAME] = $HOSTNAME
  469. ;env[PATH] = /usr/local/bin:/usr/bin:/bin
  470. ;env[TMP] = /tmp
  471. ;env[TMPDIR] = /tmp
  472. ;env[TEMP] = /tmp
  473.  
  474. ; Additional php.ini defines, specific to this pool of workers. These settings
  475. ; overwrite the values previously defined in the php.ini. The directives are the
  476. ; same as the PHP SAPI:
  477. ; php_value/php_flag - you can set classic ini defines which can
  478. ; be overwritten from PHP call 'ini_set'.
  479. ; php_admin_value/php_admin_flag - these directives won't be overwritten by
  480. ; PHP call 'ini_set'
  481. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
  482.  
  483. ; Defining 'extension' will load the corresponding shared extension from
  484. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  485. ; overwrite previously defined php.ini values, but will append the new value
  486. ; instead.
  487.  
  488. ; Note: path INI options can be relative and will be expanded with the prefix
  489. ; (pool, global or /usr/local)
  490.  
  491. ; Default Value: nothing is defined by default except the values in php.ini and
  492. ; specified at startup with the -d argument
  493. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  494. ;php_flag[display_errors] = off
  495. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  496. ;php_admin_flag[log_errors] = on
  497. ;php_admin_value[memory_limit] = 32M
  498.  
  499. [global]
  500. error_log = /home/serverweb/log/php-fpm/error.log
  501. log_level = debug
  502. ;emergency_restart_threshold = 16
  503. ;emergency_restart_interval = 5s
  504.  
  505. emergency_restart_threshold = 10
  506. emergency_restart_interval = 1m
  507. process_control_timeout = 10s
  508.  
  509. process.max = 0
  510.  
  511. [www]
  512. user = web
  513. group = web
  514.  
  515. listen = 127.0.0.1:9999
  516. listen.allowed_clients = 127.0.0.1
  517. ;listen.backlog = -1
  518.  
  519. pm = static
  520. pm.max_children = 16
  521.  
  522. ;pm.start_servers = 10
  523. ;pm.min_spare_servers = 5
  524. ;pm.max_spare_servers = 25
  525.  
  526. pm.max_requests = 10000000
  527.  
  528. slowlog = /home/serverweb/log/php-fpm/$pool.log.slow
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement