diff --git a/conf/README b/conf/README new file mode 100644 index 0000000..880cdfa --- /dev/null +++ b/conf/README @@ -0,0 +1,28 @@ +To get around the open file limit, do the following (for Ubuntu): + +sudo vim /etc/sysctl.conf + +Add the following line: +fs.file-max = 65000 + +sudo vim /etc/security/limits.conf + +Add the following lines: +www-data soft nofile 9000 +www-data hard nofile 65000 + +(restart for the above to take affect) + +sudo vim /etc/pam.d/common-session + +Add the following line: +session required pam_limits.so + +sudo sysctl -p + +sudo vim /etc/nginx/nginx.conf + +Add the following line: +worker_rlimit_nofile 9000; + +sudo service nginx restart diff --git a/conf/nginx.conf b/conf/nginx.conf index 3bd9e4c..8f8b59c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,9 +1,15 @@ -# You may add here your -# server { -# ... -# } -# statements for each of your virtual hosts to this file +user www-data; +worker_processes 8; +pid /var/run/nginx.pid; +worker_rlimit_nofile 9000; +events { + worker_connections 19000; +} + +http { + +# setup list of socket files that will receive http requests upstream mysockets { server unix:/tmp/socket-test/multiserv1.sock; server unix:/tmp/socket-test/multiserv2.sock; @@ -18,6 +24,7 @@ server { location / { proxy_pass http://mysockets; } + # browsers will auto request this file, and we don't care location = /favicon.ico { access_log off; log_not_found off; @@ -25,3 +32,4 @@ server { } } +}