Most Nginx installation guide tell you the following basics - through apt-get install, modify a few lines here and there to configure, well, you already have a Web server it! Moreover, in most cases, a conventional installation of nginx your site is already working well. However, if you really want to squeeze out nginx performance you need more depth of some. In this guide, Nike Free 3.0 V5 I'll explain Nginx can fine-tune those settings to optimize the processing performance when a large number of clients. It should be noted that this is not a comprehensive Tuning Guide. This is a simple preview - Overview of performance that can be improved by Mens Nike Free 3.0 Wool Skin Shoes Grey Navy fine-tuning settings. Your situation may be different. The basic (optimized) configuration unique file we will modify the nginx.conf, which contains all the settings Nginx different modules. You should be able to find nginx.conf in / etc / nginx directory server. First, we will talk about some global settings, then press the file module one by one to, to talk about what settings to let you have a good performance when a 554988 316 Nike Zoom KD V Jade Pink White Sale large number of client access, and why they will improve performance. End of this article there is a complete profile. Nginx.conf level configuration file, Nginx has a handful of advanced configuration on the module section. user www-data; pid /var/run/nginx.pid;worker_processes auto; worker_rlimit_nofile 100000; user and pid should press the default settings - we do not 579765-700 Sonic Yellow / Sail - Cool Grey - Tour Yellow Nike Air Max LeBron 10 Low Sonic Yellow Online change the content, because the change or not is no different. worker_processes defines the number of worder process nginx web services provided outside of. Optimal value depends on many factors, including (but not limited to) the number NIKE KD 6 NSW of CPU cores, the number of hard disks for storing data and load modes. Can not determine when it is set to the number of CPU cores available would be a good start (set to 'auto' will attempt to automatically detect it). worker_rlimit_nofile change the worker process to limit the maximum number of open files. If not set, then the value of the operating system restrictions. After setting up your operating system and Nginx can handle than 'ulimit -a' more files, so this value is set high, nginx so there would be 'too many open files' problem. Events module events nginx module contains settings for all process connections. events {worker_connections 2048; multi_accept on; use epoll;} worker_connections set the maximum number of connections that can be open at the same time a worker process. If the worker_rlimit_nofile mentioned above, we can set this value very high. Remember that the maximum number of clients are also connected by the system limits the number of available socket (~ 64K), so no good setting unrealistically high. multi_accept tell nginx connection after receiving a new notification to accept as many connections. use polling methods set multiplexing client thread is used. If you Womens Nike Lunar use Linux 2.6+, you should use epoll. If you use * BSD, 554988 316 Nike Zoom KD V Jade Pink White Sale you should use kqueue. Want to know more about the event polling? Wikipedia facie it (note, I want to know everything, then you may need neckbeard and curriculum-based operating systems) (It is worth noting that if you do not know what Nginx the polling method used, it will choose one that best suits your operating system a) HTTP module HTTP module controls all the core features of nginx http process. Because there are only a few configuration, so we only extract a small portion of the configuration. All these settings should be http module, you will not even noticed this particular setting. http {server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on; ...} speed server_tokens not make nginx executed faster, but it can be turned off in the wrong page nginx version number, this is good for security a. sendfile allows sendfile () to play a role. sendfile () can be copied between the disk and the TCP socket data with each other (or any two file descriptors). Pre-sendfile before transferring data application data buffer in user space. After using the read () to copy data from a file into this buffer, write () to write the buffer data network. sendfile () is immediately OS to read data from the disk Mens Nike Free 3.0 Wool Skin Shoes Grey Navy cache. Because of this copy is done in the kernel, sendfile () than the combination of read () and write (), and open and close more effectively discard buffer (more about sendfile) tcp_nopush tell nginx to send all Air Max 2011 Womens Grey Red Black the header files in a data package, rather than one by one to send tcp_nodelay tell nginx not Air Jordan Outlet to cache data, but sent a section of the - when you need timely delivery of data, you should set this property to the application, so that when a small piece of data sent can not be obtained immediately return value ʱ?? access_log off; error_log /var/log/nginx/error.log crit; access_log set nginx whether to store access logs. Close This option Nike Air Max allows faster read Nike Air Max 95 Women the disk IO operations (aka, YOLO) error_log tell nginx record only serious mistake keepalive_timeout 10; client_header_timeout 10; client_body_timeout 10; reset_timedout_connection on; send_timeout 10; keepalive_timeout assigned to the client keep-alive link timeout. The server will shut down the link after this timeout. We set it to be lower allows ngnix continue to work longer. client_header_timeout and client_body_timeout set request headers and request body (each) timeout. We can also put some of this low setting. reset_timeout_connection tell nginx closed unresponsive client connections. This will release the memory space occupied by the client. send_timeout specified client response timeout. This setting is not used throughout the transponder, but in between the two client read operation. If during this time, the client does not read any data, nginx will close the connection. limit_conn_zone $ binary_remote_addr zone = addr: 5m; limit_conn addr 100; limit_conn_zone set various parameters for saving key (such as the current number of connections) of shared memory. 5m is 5 megabytes, big enough this value should be set to store (32K * 5) 32byte state or (16K * 5) 64byte state. limit_conn for a given key to set the maximum number of connections. Here is the key addr, we set the value is 100, which means that we allow each IP address to open up to 100 simultaneous connections. include /etc/nginx/mime.types;default_type text / html; charset UTF-8; include only one command to another file that contains the contents of the current file. Here we use it to load a series of MIME type will be used later. The default MIME-type default_type settings files. charset set our headers in the default character set for enhancing the performance of the following two points are explained in great WebMasters StackExchange in. gzip on; gzip_disable \u0026 quot; msie6 \u0026 quot ;; # gzip_static on; gzip_proxied any; gzip_min_length 1000; gzip_comp_level 4; gzip_types text / plain text / css application / json application / x-javascript text / xml application / xml application / xml + rss text / javascript; gzip tells gzip compressed form using nginx send data. This will reduce the amount of data sent by us. gzip_disable for the specified client function disabled gzip. We arranged to IE6 or earlier versions of the program so that we can be widely compatible. gzip_static tell nginx before compression resources, first find out if there is pre-treated gzip resources. This requires that you pre-compress your files (in this example is commented out), allowing you to use the highest compression ratio, so nginx will not need to compress these files (gzip_static want more detailed information, please click here) ʱ?? gzip_proxied allow or prohibit compressed response based on the request and response flow. We set any, it will mean that all requests compression. gzip_min_length set the minimum number of bytes of data compression enabled. If a request is less than 1000 bytes, we'd better not compress it, because these small data compression will reduce the processing speed of all processes of this request. gzip_comp_level setting data compression level. This level can be any value between 1-9, 9 is slowest but maximum compression ratio. We set to 4, which is a more eclectic setting. gzip_type settings need compressed data format. There have been some examples above, you can also add more formats. # Cache informations about file descriptors, frequently accessed files # can boost performance, but you need to Air Max 2011 Womens Blue Black test those valuesopen_file_cache max = 100000 inactive = 20s; open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on; ### Virtual Host Configs # aka our settings for specific servers ## include /etc/nginx/conf.d/*.conf;include / etc / nginx / sites-enabled / *; open_file_cache open cache also specifies the maximum number of Nike Air Max 95 Women cache, and cache time. We can set a relatively high maximum time, so that we can more than 20 seconds of inactivity after 2015 Nike Free 5.0 cleared them. open_file_cache_valid designated detect the correct information in open_file_cache the interval. open_file_cache_min_uses open_file_cache instructions defined parameters during the period of inactivity in the minimum number of files. open_file_cache_errors specify when searching for a file is cached error information, including re-added to the configuration file. We also include the server module, which is defined in a different file. If your server module is not in these positions, you have to change this line to specify the correct location. A complete configuration user www-data; pid /var/run/nginx.pid;worker_processes auto; worker_rlimit_nofile 100000; events {worker_connections 2048; multi_accept on; use epoll;} http {server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on ; access_log off; error_log /var/log/nginx/error.log crit; keepalive_timeout 10; client_header_timeout 10; client_body_timeout 10; reset_timedout_connection on; send_timeout 10; limit_conn_zone $ binary_remote_addr zone = addr: 5m; limit_conn addr 100; include / etc / nginx /mime.types; default_type text / html; charset UTF-8; gzip on; gzip_disable \u0026 quot; msie6 \u0026 quot ;; gzip_proxied any; gzip_min_length 1000; gzip_comp_level 6; gzip_types text / plain text / css application / json application / x-javascript text / xml application / xml application / xml + rss text / javascript; open_file_cache max = 100000 inactive = 20s; open_file_cache_valid 30s; open_file_cache_min_uses 2; open_file_cache_errors on; include /etc/nginx/conf.d/*.conf; include / etc / nginx / sites-enabled / *;} After you edit the configuration, make sure to restart nginx settings to take effect. sudo service nginx restart postscript so! Your Web server is now ready, before bothering you many visitors problems come. This is not the only way to speed up the website, and soon I'll write more articles that describe other methods of accelerated site.Nginx combat readiness - Optimization Guide