Browse Source

Php initial optimize (#3581)

* php-fpm.conf optimize

* php.ini optimize

* nginx.conf optimize
Only for php no frameworks
Joan Miquel 7 years ago
parent
commit
bec5286086

+ 6 - 6
frameworks/PHP/php/deploy/conf/php-fpm.conf

@@ -107,7 +107,7 @@ error_log = /dev/stderr
 ; Available Units: s(econds), m(inutes), h(ours)
 ; Default Unit: seconds
 ; Default value: 10
-;systemd_interval = 10
+systemd_interval = 0
 
 ;;;;;;;;;;;;;;;;;;;;
 ; Pool Definitions ;
@@ -165,7 +165,7 @@ listen = /run/php/php7.2-fpm.sock
 
 ; Set listen(2) backlog.
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
-;listen.backlog = 511
+listen.backlog = 4096
 
 ; Set permissions for unix socket, if one is used. In Linux, read/write
 ; permissions must be set in order to allow connections from a web server. Many
@@ -238,22 +238,22 @@ pm = dynamic
 ; forget to tweak pm.* to fit your needs.
 ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
 ; Note: This value is mandatory.
-pm.max_children = 5
+pm.max_children = 1024
 
 ; The number of child processes created on startup.
 ; Note: Used only when pm is set to 'dynamic'
 ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
-pm.start_servers = 2
+pm.start_servers = 512
 
 ; The desired minimum number of idle server processes.
 ; Note: Used only when pm is set to 'dynamic'
 ; Note: Mandatory when pm is set to 'dynamic'
-pm.min_spare_servers = 1
+pm.min_spare_servers = 50
 
 ; The desired maximum number of idle server processes.
 ; Note: Used only when pm is set to 'dynamic'
 ; Note: Mandatory when pm is set to 'dynamic'
-pm.max_spare_servers = 3
+pm.max_spare_servers = 512
 
 ; The number of seconds after which an idle process will be killed.
 ; Note: Used only when pm is set to 'ondemand'

+ 8 - 8
frameworks/PHP/php/deploy/conf/php.ini

@@ -311,7 +311,7 @@ serialize_precision = -1
 ; This directive allows you to disable certain functions for security reasons.
 ; It receives a comma-delimited list of function names.
 ; http://php.net/disable-functions
-disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
+disable_functions = 
 
 ; This directive allows you to disable certain classes for security reasons.
 ; It receives a comma-delimited list of class names.
@@ -338,13 +338,13 @@ disable_classes =
 ; be increased on systems where PHP opens many files to reflect the quantity of
 ; the file operations performed.
 ; http://php.net/realpath-cache-size
-;realpath_cache_size = 4096k
+realpath_cache_size = 4096k
 
 ; Duration of time, in seconds for which to cache realpath information for a given
 ; file or directory. For systems with rarely changing files, consider increasing this
 ; value.
 ; http://php.net/realpath-cache-ttl
-;realpath_cache_ttl = 120
+realpath_cache_ttl = 600
 
 ; Enables or disables the circular reference collector.
 ; http://php.net/zend.enable-gc
@@ -936,7 +936,7 @@ cli_server.color = On
 [Date]
 ; Defines the default timezone used by the date functions
 ; http://php.net/date.timezone
-;date.timezone =
+date.timezone = UTC
 
 ; http://php.net/date.default-latitude
 ;date.default_latitude = 31.7667
@@ -1188,7 +1188,7 @@ mysqli.reconnect = Off
 ; Enable / Disable collection of general statistics by mysqlnd which can be
 ; used to tune and monitor MySQL operations.
 ; http://php.net/mysqlnd.collect_statistics
-mysqlnd.collect_statistics = On
+mysqlnd.collect_statistics = Off
 
 ; Enable / Disable collection of memory usage statistics by mysqlnd which can be
 ; used to tune and monitor MySQL operations.
@@ -1764,7 +1764,7 @@ ldap.max_links = -1
 
 [opcache]
 ; Determines if Zend OPCache is enabled
-;opcache.enable=1
+opcache.enable=1
 
 ; Determines if Zend OPCache is enabled for the CLI version of PHP
 ;opcache.enable_cli=0
@@ -1790,7 +1790,7 @@ ldap.max_links = -1
 
 ; When disabled, you must reset the OPcache manually or restart the
 ; webserver for changes to the filesystem to take effect.
-;opcache.validate_timestamps=1
+opcache.validate_timestamps=0
 
 ; How often (in seconds) to check file timestamps for changes to the shared
 ; memory storage allocation. ("1" means validate once per second, but only
@@ -1878,7 +1878,7 @@ ldap.max_links = -1
 
 ; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
 ; This should improve performance, but requires appropriate OS configuration.
-;opcache.huge_code_pages=1
+opcache.huge_code_pages=1
 
 ; Validate cached file permissions.
 ;opcache.validate_permission=0

+ 0 - 4
frameworks/PHP/php/deploy/nginx5.conf

@@ -47,10 +47,6 @@ http {
         root /php/;
         index  index.php;
 
-        location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
         location ~ \.php$ {
             try_files $uri =404;
             fastcgi_pass   fastcgi_backend;

+ 0 - 4
frameworks/PHP/php/deploy/nginx7.conf

@@ -47,10 +47,6 @@ http {
         root /php/;
         index  index.php;
 
-        location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
         location ~ \.php$ {
             try_files $uri =404;
             fastcgi_pass   fastcgi_backend;