Browse Source

Tweak nginx.

I used some tested optimization that I use in my server.
Bruno Cabral 10 years ago
parent
commit
d8ea4b828d
1 changed files with 26 additions and 4 deletions
  1. 26 4
      frameworks/PHP/php-laravel/deploy/nginx.conf

+ 26 - 4
frameworks/PHP/php-laravel/deploy/nginx.conf

@@ -1,7 +1,9 @@
 worker_processes  8;
 
 events {
-    worker_connections  1024;
+    worker_connections 2048;
+	multi_accept on;
+	use epoll;
 }
 
 http {
@@ -9,8 +11,28 @@ http {
     default_type  application/octet-stream;
     access_log off;
 
-    sendfile        on;
-    keepalive_timeout  65;
+    sendfile on;
+	tcp_nopush on;
+	tcp_nodelay on;
+	keepalive_timeout 65;
+	
+	open_file_cache max=2000 inactive=20s;
+	open_file_cache_valid 60s;
+	open_file_cache_min_uses 5;
+	open_file_cache_errors off; 
+
+	#FastCGI optimizations
+	fastcgi_buffers 256 16k;
+	fastcgi_buffer_size 128k;
+	fastcgi_connect_timeout 30s;
+	fastcgi_send_timeout 60s;
+	fastcgi_read_timeout 60s;
+	fastcgi_busy_buffers_size 256k;
+	fastcgi_temp_file_write_size 256k;
+	reset_timedout_connection on;
+	server_names_hash_bucket_size 100;
+	
+	
 
     upstream fastcgi_backend {
         server 127.0.0.1:9001;
@@ -39,4 +61,4 @@ http {
             include        /home/vagrant/FrameworkBenchmarks/installs/nginx/conf/fastcgi_params;
         }
     }
-}
+}