瀏覽代碼

Update nginx.conf (#5358)

* Update nginx.conf in php and kumbiaphp

* More changes in nginx.conf

* Update to use php-fpm without version
Easier to change when update

* Fix php-raw-tcp
Joan Miquel 5 年之前
父節點
當前提交
a6678a19dd

+ 5 - 5
frameworks/PHP/kumbiaphp/deploy/conf/php-fpm.conf

@@ -14,14 +14,14 @@
 ; Pid file
 ; Pid file
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: none
 ; Default Value: none
-pid = /run/php/php7.3-fpm.pid
+pid = /run/php/php-fpm.pid
 
 
 ; Error log file
 ; Error log file
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; into a local file.
 ; into a local file.
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: log/php-fpm.log
 ; Default Value: log/php-fpm.log
-;error_log = /var/log/php7.3-fpm.log
+;error_log = /var/log/php-fpm.log
 error_log = /dev/stderr
 error_log = /dev/stderr
 
 
 
 
@@ -124,7 +124,7 @@ systemd_interval = 0
 ; Relative path can also be used. They will be prefixed by:
 ; Relative path can also be used. They will be prefixed by:
 ;  - the global prefix if it's been set (-p argument)
 ;  - the global prefix if it's been set (-p argument)
 ;  - /usr otherwise
 ;  - /usr otherwise
-;include=/etc/php/7.3/fpm/pool.d/*.conf
+;include=/etc/php/7.4/fpm/pool.d/*.conf
 
 
 ; Start a new pool named 'www'.
 ; Start a new pool named 'www'.
 ; the variable $pool can be used in any directive and will be replaced by the
 ; the variable $pool can be used in any directive and will be replaced by the
@@ -161,7 +161,7 @@ group = www-data
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ; Note: This value is mandatory.
 ; Note: This value is mandatory.
-listen = /run/php/php7.3-fpm.sock
+listen = /run/php/php-fpm.sock
 
 
 ; Set listen(2) backlog.
 ; Set listen(2) backlog.
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
@@ -357,7 +357,7 @@ pm.max_spare_servers = 512
 ;   last request memory:  0
 ;   last request memory:  0
 ;
 ;
 ; Note: There is a real-time FPM status monitoring sample web page available
 ; Note: There is a real-time FPM status monitoring sample web page available
-;       It's available in: /usr/share/php/7.3/fpm/status.html
+;       It's available in: /usr/share/php/7.4/fpm/status.html
 ;
 ;
 ; Note: The value must start with a leading slash (/). The value can be
 ; Note: The value must start with a leading slash (/). The value can be
 ;       anything, but it may not be a good idea to use the .php extension or it
 ;       anything, but it may not be a good idea to use the .php extension or it

+ 4 - 5
frameworks/PHP/kumbiaphp/deploy/nginx.conf

@@ -1,13 +1,13 @@
 user www-data;
 user www-data;
+worker_cpu_affinity auto;
 worker_processes  auto;
 worker_processes  auto;
 error_log stderr error;
 error_log stderr error;
 #worker_rlimit_nofile 2000000;
 #worker_rlimit_nofile 2000000;
-timer_resolution 1000ms;
+timer_resolution 1s;
 
 
 events {
 events {
     worker_connections 16384;
     worker_connections 16384;
 	multi_accept off;
 	multi_accept off;
-	 
 }
 }
 
 
 http {
 http {
@@ -22,7 +22,7 @@ http {
     keepalive_timeout 65;
     keepalive_timeout 65;
     keepalive_disable none;
     keepalive_disable none;
     #fastcgi_ignore_client_abort on;
     #fastcgi_ignore_client_abort on;
-    keepalive_requests 10000;
+    keepalive_requests 10000000;
 
 
     #the bench don't use any static file
     #the bench don't use any static file
     #open_file_cache max=2000 inactive=20s;
     #open_file_cache max=2000 inactive=20s;
@@ -43,9 +43,8 @@ http {
 
 
 
 
     upstream fastcgi_backend {
     upstream fastcgi_backend {
-        server unix:/var/run/php/php7.3-fpm.sock;
+        server unix:/var/run/php/php-fpm.sock;
         keepalive 36;
         keepalive 36;
-        
     }
     }
 
 
     server {
     server {

+ 7 - 7
frameworks/PHP/php/deploy/conf/php-fpm-pools.conf

@@ -14,14 +14,14 @@
 ; Pid file
 ; Pid file
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: none
 ; Default Value: none
-pid = /run/php/php7.3-fpm.pid
+pid = /run/php/php-fpm.pid
 
 
 ; Error log file
 ; Error log file
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; into a local file.
 ; into a local file.
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: log/php-fpm.log
 ; Default Value: log/php-fpm.log
-;error_log = /var/log/php7.3-fpm.log
+;error_log = /var/log/php-fpm.log
 error_log = /dev/stderr
 error_log = /dev/stderr
 
 
 
 
@@ -84,7 +84,7 @@ error_log = /dev/stderr
 
 
 ; Set open file descriptor rlimit for the master process.
 ; Set open file descriptor rlimit for the master process.
 ; Default Value: system defined value
 ; Default Value: system defined value
-;rlimit_files = 1024
+;rlimit_files = 1024000
 
 
 ; Set max core size rlimit for the master process.
 ; Set max core size rlimit for the master process.
 ; Possible Values: 'unlimited' or an integer greater or equal to 0
 ; Possible Values: 'unlimited' or an integer greater or equal to 0
@@ -124,7 +124,7 @@ systemd_interval = 0
 ; Relative path can also be used. They will be prefixed by:
 ; Relative path can also be used. They will be prefixed by:
 ;  - the global prefix if it's been set (-p argument)
 ;  - the global prefix if it's been set (-p argument)
 ;  - /usr otherwise
 ;  - /usr otherwise
-;include=/etc/php/7.3/fpm/pool.d/*.conf
+;include=/etc/php/7.4/fpm/pool.d/*.conf
 
 
 ; Start a new pool named 'www'.
 ; Start a new pool named 'www'.
 ; the variable $pool can be used in any directive and will be replaced by the
 ; the variable $pool can be used in any directive and will be replaced by the
@@ -161,7 +161,7 @@ group = www-data
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ; Note: This value is mandatory.
 ; Note: This value is mandatory.
-listen = /run/php/php7.3-fpm.sock
+listen = /run/php/php-fpm.sock
 
 
 ; Set listen(2) backlog.
 ; Set listen(2) backlog.
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
@@ -357,7 +357,7 @@ pm.max_spare_servers = 512
 ;   last request memory:  0
 ;   last request memory:  0
 ;
 ;
 ; Note: There is a real-time FPM status monitoring sample web page available
 ; Note: There is a real-time FPM status monitoring sample web page available
-;       It's available in: /usr/share/php/7.3/fpm/status.html
+;       It's available in: /usr/share/php/7.4/fpm/status.html
 ;
 ;
 ; Note: The value must start with a leading slash (/). The value can be
 ; Note: The value must start with a leading slash (/). The value can be
 ;       anything, but it may not be a good idea to use the .php extension or it
 ;       anything, but it may not be a good idea to use the .php extension or it
@@ -556,7 +556,7 @@ pm.max_spare_servers = 512
 user = www-data
 user = www-data
 group = www-data
 group = www-data
 
 
-listen = /run/php/php7.3-fpm-2.sock
+listen = /run/php/php-fpm-2.sock
 
 
 ; Set listen(2) backlog.
 ; Set listen(2) backlog.
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)

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

@@ -14,14 +14,14 @@
 ; Pid file
 ; Pid file
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: none
 ; Default Value: none
-pid = /run/php/php7.3-fpm.pid
+pid = /run/php/php-fpm.pid
 
 
 ; Error log file
 ; Error log file
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; into a local file.
 ; into a local file.
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: log/php-fpm.log
 ; Default Value: log/php-fpm.log
-;error_log = /var/log/php7.3-fpm.log
+;error_log = /var/log/php-fpm.log
 error_log = /dev/stderr
 error_log = /dev/stderr
 
 
 
 
@@ -84,7 +84,7 @@ process.max = 0
 
 
 ; Set open file descriptor rlimit for the master process.
 ; Set open file descriptor rlimit for the master process.
 ; Default Value: system defined value
 ; Default Value: system defined value
-rlimit_files = 100000
+rlimit_files = 1000000
 
 
 ; Set max core size rlimit for the master process.
 ; Set max core size rlimit for the master process.
 ; Possible Values: 'unlimited' or an integer greater or equal to 0
 ; Possible Values: 'unlimited' or an integer greater or equal to 0
@@ -124,7 +124,7 @@ systemd_interval = 0
 ; Relative path can also be used. They will be prefixed by:
 ; Relative path can also be used. They will be prefixed by:
 ;  - the global prefix if it's been set (-p argument)
 ;  - the global prefix if it's been set (-p argument)
 ;  - /usr otherwise
 ;  - /usr otherwise
-;include=/etc/php/7.3/fpm/pool.d/*.conf
+;include=/etc/php/7.4/fpm/pool.d/*.conf
 
 
 ; Start a new pool named 'www'.
 ; Start a new pool named 'www'.
 ; the variable $pool can be used in any directive and will be replaced by the
 ; the variable $pool can be used in any directive and will be replaced by the
@@ -161,7 +161,7 @@ group = www-data
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ; Note: This value is mandatory.
 ; Note: This value is mandatory.
-listen = /run/php/php7.3-fpm.sock
+listen = /run/php/php-fpm.sock
 
 
 ; Set listen(2) backlog.
 ; Set listen(2) backlog.
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
@@ -357,7 +357,7 @@ pm.max_spare_servers = 512
 ;   last request memory:  0
 ;   last request memory:  0
 ;
 ;
 ; Note: There is a real-time FPM status monitoring sample web page available
 ; Note: There is a real-time FPM status monitoring sample web page available
-;       It's available in: /usr/share/php/7.3/fpm/status.html
+;       It's available in: /usr/share/php/7.4/fpm/status.html
 ;
 ;
 ; Note: The value must start with a leading slash (/). The value can be
 ; Note: The value must start with a leading slash (/). The value can be
 ;       anything, but it may not be a good idea to use the .php extension or it
 ;       anything, but it may not be a good idea to use the .php extension or it

+ 1 - 1
frameworks/PHP/php/deploy/h2o.conf

@@ -16,5 +16,5 @@ file.custom-handler:                  # handle PHP scripts
   extension: .php
   extension: .php
   fastcgi.timeout.keepalive: 3900
   fastcgi.timeout.keepalive: 3900
   fastcgi.connect:
   fastcgi.connect:
-    port: /var/run/php/php7.3-fpm.sock
+    port: /var/run/php/php-fpm.sock
     type: unix
     type: unix

+ 5 - 4
frameworks/PHP/php/deploy/nginx-pools.conf

@@ -1,7 +1,8 @@
 user www-data;
 user www-data;
+worker_cpu_affinity auto;
 worker_processes  auto;
 worker_processes  auto;
 error_log stderr error;
 error_log stderr error;
-timer_resolution 1000ms;
+timer_resolution 1s;
 #worker_rlimit_nofile 2000000;
 #worker_rlimit_nofile 2000000;
 pcre_jit on;
 pcre_jit on;
 
 
@@ -23,7 +24,7 @@ http {
     keepalive_timeout 65;
     keepalive_timeout 65;
     keepalive_disable none;
     keepalive_disable none;
     #fastcgi_ignore_client_abort on;
     #fastcgi_ignore_client_abort on;
-    keepalive_requests 10000;
+    keepalive_requests 100000;
 
 
     #the bench don't use any static file
     #the bench don't use any static file
     #open_file_cache max=2000 inactive=20s;
     #open_file_cache max=2000 inactive=20s;
@@ -44,8 +45,8 @@ http {
 
 
 
 
     upstream fastcgi_backend {
     upstream fastcgi_backend {
-        server unix:/var/run/php/php7.3-fpm.sock;
-        server unix:/var/run/php/php7.3-fpm-2.sock;
+        server unix:/var/run/php/php-fpm.sock;
+        server unix:/var/run/php/php-fpm-2.sock;
         keepalive 36;
         keepalive 36;
     }
     }
 
 

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

@@ -1,7 +1,8 @@
 user www-data;
 user www-data;
+worker_cpu_affinity auto;
 worker_processes  auto;
 worker_processes  auto;
 error_log stderr error;
 error_log stderr error;
-timer_resolution 1000ms;
+timer_resolution 1s;
 #worker_rlimit_nofile 2000000;
 #worker_rlimit_nofile 2000000;
 pcre_jit on;
 pcre_jit on;
 
 
@@ -12,7 +13,7 @@ events {
 }
 }
 
 
 http {
 http {
-    include       /etc/nginx/mime.types;
+    #include       /etc/nginx/mime.types;
     default_type  application/octet-stream;
     default_type  application/octet-stream;
     access_log off;
     access_log off;
     server_tokens off;
     server_tokens off;
@@ -23,7 +24,7 @@ http {
     keepalive_timeout 65;
     keepalive_timeout 65;
     keepalive_disable none;
     keepalive_disable none;
     #fastcgi_ignore_client_abort on;
     #fastcgi_ignore_client_abort on;
-    keepalive_requests 10000;
+    keepalive_requests 10000000;
 
 
     #the bench don't use any static file
     #the bench don't use any static file
     #open_file_cache max=2000 inactive=20s;
     #open_file_cache max=2000 inactive=20s;
@@ -44,7 +45,7 @@ http {
     fastcgi_socket_keepalive on;
     fastcgi_socket_keepalive on;
 
 
     upstream fastcgi_backend {
     upstream fastcgi_backend {
-        server unix:/var/run/php/php7.3-fpm.sock;
+        server unix:/var/run/php/php-fpm.sock;
         keepalive 36;
         keepalive 36;
     }
     }
 
 

+ 2 - 2
frameworks/PHP/php/php-raw7-tcp.dockerfile

@@ -12,8 +12,8 @@ COPY deploy/conf/* /etc/php/7.4/fpm/
 ADD ./ /php
 ADD ./ /php
 WORKDIR /php
 WORKDIR /php
 
 
-RUN sed -i "s|listen = /run/php/php7.4-fpm.sock|listen = 127.0.0.1:9001|g" /etc/php/7.4/fpm/php-fpm.conf
-RUN sed -i "s|server unix:/var/run/php/php7.4-fpm.sock;|server 127.0.0.1:9001;|g" deploy/nginx7.conf
+RUN sed -i "s|listen = /run/php/php-fpm.sock|listen = 127.0.0.1:9001|g" /etc/php/7.4/fpm/php-fpm.conf
+RUN sed -i "s|server unix:/var/run/php/php-fpm.sock;|server 127.0.0.1:9001;|g" deploy/nginx7.conf
 
 
 RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/7.4/fpm/php-fpm.conf ; fi;
 RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/7.4/fpm/php-fpm.conf ; fi;