Welcome! Log In Create A New Profile


Best Nginx settings ?

Posted by Fnux 
Best Nginx settings ?
October 09, 2013 09:47AM

I am working on a comparative review for a newspaper and I need help to better reflect Nginx capabilities on our benchmark made on a 40 gigabit Ethernet LAN.

How can I configure Nginx to serve static files in the 200KB - 16MB range as fast as possible?

Here is my current attempt to configure Nginx. Do you see anything that should be modified or added?

# ---------------------------------------------------
# Nginx configuration for 200KB-16MB static files # (enabled HTTP headers, gzip and directory listing # capabilities are also needed) # ---------------------------------------------------
user www-data;

# must match your number of CPU cores
worker_processes 8;

# max open files
worker_rlimit_nofile 200000;

pid /var/run/nginx.pid;

events {
# concurrent clients served by worker
worker_connections 4096;

# accept() as many connections as possible
multi_accept on;

http {
charset utf-8; # HTTP "Content-Type:" header
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 30;
keepalive_requests 100000;

types_hash_max_size 2048;
include /usr/local/nginx/conf/mime.types;
default_type application/octet-stream;

gzip on;
gzip_min_length 500;

gzip_vary on; # HTTP "Vary: Accept-Encoding" header
gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss text/javascript;

server {
index index.html;
server_name localhost;

access_log off;

# only log critical errors
error_log /usr/local/nginx/logs/error.log crit;

root /usr/local/nginx/html;
location /imgs {
autoindex on;

Any help will be appreciated.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 101
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready