nginxarchitecture
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
nginxarchitecture [2017/03/24 05:57] – [PHP-FPM Config and Optimize] admin | nginxarchitecture [2022/10/29 16:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 28: | Line 28: | ||
===== Optimize nginx configuration for performance and benchmark ===== | ===== Optimize nginx configuration for performance and benchmark ===== | ||
refer: | refer: | ||
+ | * http:// | ||
* http:// | * http:// | ||
* http:// | * http:// | ||
Line 139: | Line 140: | ||
=> with above benchmarch for static file ab -n 20 -c 4 http:// | => with above benchmarch for static file ab -n 20 -c 4 http:// | ||
===== PHP-FPM Config and Optimize ===== | ===== PHP-FPM Config and Optimize ===== | ||
- | refer: https:// | + | refer: |
+ | * https:// | ||
+ | * https:// | ||
**global** config for all pools:< | **global** config for all pools:< | ||
Line 196: | Line 199: | ||
(In some case, the php-fpm child processes full memory and can't process the request, these configurations will automatically restart the php-fpm child processes) | (In some case, the php-fpm child processes full memory and can't process the request, these configurations will automatically restart the php-fpm child processes) | ||
==== PHP-FPM Pools Configuration ==== | ==== PHP-FPM Pools Configuration ==== | ||
- | refer: http:// | ||
=== Basic Config === | === Basic Config === | ||
Default php-fpm will use pool **[www]** to configuration for all site. In advance, it’s possible to use **different pools** for different sites and **allocate resources very accurately** and even use **different users and groups for every pool**. Following is just example configuration files structure for PHP-FPM pools for three different sites (or actually three different part of same site):< | Default php-fpm will use pool **[www]** to configuration for all site. In advance, it’s possible to use **different pools** for different sites and **allocate resources very accurately** and even use **different users and groups for every pool**. Following is just example configuration files structure for PHP-FPM pools for three different sites (or actually three different part of same site):< | ||
Line 202: | Line 204: | ||
/ | / | ||
/ | / | ||
- | </ | + | </ |
+ | Or config in php-fpm.conf< | ||
+ | ; Relative path can also be used. They will be prefixed by: | ||
+ | ; - the global prefix if it's been set (-p argument) | ||
+ | ; - /onec/php otherwise | ||
+ | ; | ||
+ | </ | ||
Just example configurations for every pool: | Just example configurations for every pool: | ||
+ | * default pool [www](listen on port 9000)< | ||
+ | [www] | ||
+ | |||
+ | ; Per pool prefix | ||
+ | ; It only applies on the following directives: | ||
+ | ; - ' | ||
+ | ; - ' | ||
+ | ; - ' | ||
+ | ; - ' | ||
+ | ; - ' | ||
+ | ; - ' | ||
+ | ; - ' | ||
+ | ; When not set, the global prefix (or /onec/php) applies instead. | ||
+ | ; Note: This directive can also be relative to the global prefix. | ||
+ | ; Default Value: none | ||
+ | ;prefix = / | ||
+ | |||
+ | ; Unix user/group of processes | ||
+ | ; Note: The user is mandatory. If the group is not set, the default user's group | ||
+ | ; will be used. | ||
+ | user = nobody | ||
+ | group = nobody | ||
+ | |||
+ | ; The address on which to accept FastCGI requests. | ||
+ | ; Valid syntaxes are: | ||
+ | ; ' | ||
+ | ; a specific port; | ||
+ | ; ' | ||
+ | ; a specific port; | ||
+ | ; ' | ||
+ | ; specific port; | ||
+ | ; ' | ||
+ | ; (IPv6 and IPv4-mapped) on a specific port; | ||
+ | ; '/ | ||
+ | ; Note: This value is mandatory. | ||
+ | listen = 127.0.0.1: | ||
+ | |||
+ | </ | ||
* / | * / | ||
[site] | [site] |
nginxarchitecture.1490335039.txt.gz · Last modified: 2022/10/29 16:15 (external edit)