Browse Source

Lower keepalive requests (#4384)

* Lower keepalive requests

* Faster FCGI config
Rest of frameworks #4341

* Revert slim config
Fail

* Faster FCGI config
Yii2 hhvm #4341

* Optimize fortune php raw
Joan Miquel 6 years ago
parent
commit
4ab2980fe6

+ 2 - 7
frameworks/PHP/cakephp/deploy/nginx.conf

@@ -48,15 +48,10 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 2 - 7
frameworks/PHP/clancats/deploy/nginx.conf

@@ -30,15 +30,10 @@ http {
 		index  index.php;
 
 		location / {
-			try_files $uri $uri/ /index.php?$uri&$args;
-		}
-
-		location ~ \.php$ {
-
 			fastcgi_pass   fastcgi_backend;
 			fastcgi_keep_conn on;
-			fastcgi_index  index.php;
-			fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+			fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+			fastcgi_param  PATH_INFO        $uri;
 			include        /etc/nginx/fastcgi_params;
 		}
 	}

+ 2 - 7
frameworks/PHP/fuel/deploy/nginx.conf

@@ -50,15 +50,10 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 2 - 6
frameworks/PHP/hamlet/deploy/nginx-fpm.conf

@@ -45,14 +45,10 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 2 - 7
frameworks/PHP/laravel/deploy/nginx.conf

@@ -50,15 +50,10 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$query_string;
-        }
-
-        location ~ \.php$ {
-             
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 3 - 7
frameworks/PHP/limonade/deploy/nginx.conf

@@ -50,15 +50,11 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-             
+            #try_files $uri $uri/ /index.php?$uri&$args;
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 2 - 7
frameworks/PHP/lithium/deploy/nginx.conf

@@ -50,15 +50,10 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-             
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 3 - 8
frameworks/PHP/lumen/deploy/nginx.conf

@@ -50,16 +50,11 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-             
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }
-}
+}   

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

@@ -19,7 +19,7 @@ http {
     tcp_nodelay on;
     keepalive_timeout 65s;
     keepalive_disable none;
-    keepalive_requests 300000;
+    keepalive_requests 1000;
 
     php_ini_path /deploy/conf/php.ini;
 

+ 2 - 5
frameworks/PHP/php/fortune.php

@@ -8,12 +8,9 @@
 $pdo = new PDO('mysql:host=tfb-database;dbname=hello_world', 'benchmarkdbuser', 'benchmarkdbpass', array(
     PDO::ATTR_PERSISTENT => true
 ));
-
-// Define query
-$statement = $pdo->query( 'SELECT id, message FROM Fortune' );
   
-// Store result in array.
-$arr = $statement->fetchAll(PDO::FETCH_KEY_PAIR); 
+// Define query and store result in array.
+$arr = $pdo->query( 'SELECT id, message FROM Fortune' )->fetchAll(PDO::FETCH_KEY_PAIR); 
 $arr[0] = 'Additional fortune added at request time.';
 
 asort($arr);

+ 2 - 7
frameworks/PHP/phreeze/deploy/nginx.conf

@@ -50,15 +50,10 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-             
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 3 - 7
frameworks/PHP/silex/deploy/nginx.conf

@@ -50,15 +50,11 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-             
+            #try_files $uri $uri/ /index.php?$uri&$args;
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 2 - 3
frameworks/PHP/slim/deploy/nginx-fpm-5.conf

@@ -50,14 +50,13 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
+            try_files $uri /index.php?$uri&$args;
         }
 
         location ~ \.php$ {
-             
+
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
             include        /etc/nginx/fastcgi_params;
         }

+ 2 - 3
frameworks/PHP/slim/deploy/nginx-fpm-7.conf

@@ -50,14 +50,13 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
+            try_files $uri /index.php?$uri&$args;
         }
 
         location ~ \.php$ {
-             
+
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
             include        /etc/nginx/fastcgi_params;
         }

+ 3 - 8
frameworks/PHP/symfony/deploy/nginx.conf

@@ -50,16 +50,11 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-             
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
-            fastcgi_param   APP_ENV  prod;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  APP_ENV          prod;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }

+ 0 - 1
frameworks/PHP/yii2/deploy/nginx-fpm.conf

@@ -33,7 +33,6 @@ http {
             fastcgi_param  SCRIPT_FILENAME    $document_root/index.php;
             fastcgi_param  PATH_INFO          $uri;
             include        /etc/nginx/fastcgi_params;
-            #fastcgi_param  QUERY_STRING       $uri&$query_string;
         }
     }
 }

+ 2 - 7
frameworks/PHP/zend/deploy/nginx.conf

@@ -31,15 +31,10 @@ http {
         index  index.php;
 
         location / {
-            try_files $uri $uri/ /index.php?$uri&$args;
-        }
-
-        location ~ \.php$ {
-             
             fastcgi_pass   fastcgi_backend;
             fastcgi_keep_conn on;
-            fastcgi_index  index.php;
-            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
+            fastcgi_param  PATH_INFO        $uri;
             include        /etc/nginx/fastcgi_params;
         }
     }