{"id":7709,"date":"2020-02-25T14:59:20","date_gmt":"2020-02-25T11:59:20","guid":{"rendered":"http:\/\/unihost.com\/help\/?p=7709"},"modified":"2023-10-09T17:03:26","modified_gmt":"2023-10-09T14:03:26","slug":"tuning-nginx-for-performance","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/","title":{"rendered":"Tuning NGINX for Performance"},"content":{"rendered":"<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/unihost.com\/help\/minio.php?NGINX-logo.png\" alt=\"Tuning NGINX for Performance - Image 1\" width=\"1921\" height=\"645\" \/ title=\"Tuning NGINX for Performance - Image 1\"><\/span><\/p>\n<h2 id=\"id-06.\u0422\u044e\u043d\u0438\u043d\u0433\u0441\u0435\u0440\u0432\u0435\u0440\u0430NGINX-\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435worker_processes\" style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"><span lang=\"ru\"><span title=\"\">Setup <\/span><\/span><span lang=\"ru\"><span title=\"\">worker_processes<\/span><\/span><\/span><\/h2>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">The architecture of the Nginx master and worker processes is explained as follows: &#8220;nginx has one master process and several worker processes. The main goal of the master process is to read and evaluate the configuration, as well as support worker processes. Worker processes actually handle requests. Nginx uses an event-based model and OS-specific mechanisms to efficiently distribute requests between worker processes.&#8221;<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">In other words, worker_processes tells your <a href=\"https:\/\/unihost.com\/en\/dedicated\/\">server<\/a> how many cores are assigned so that Nginx can manage requests in an optimized way. Default Nginx configuration path: <em>\/etc\/nginx\/nginx.conf<\/em><\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To find out how many cores you have on your web server, run the following command.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># grep processor \/proc\/cpuinfo | wc \u2013l<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">4<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Worker_connections tells worker_processes how many clients Nginx can serve at one time. The default value is 768, but it is important to remember that each browser usually opens at least 2 connections to the server. The maximum number for setting worker_processes is 1024, and it is best to use this to get the full potential from Nginx. Based on this, taking into account one core for each worker_processes, setting worker_connections to 1024 means that Nginx can serve 1024 clients per second.<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">worker_processes\u00a0\u00a04;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">events {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0worker_connections\u00a0\u00a08096;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0multi_accept\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0use\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 epoll;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">worker_rlimit_nofile 100000;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">error_log \/var\/log\/nginx\/error.log crit;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">http {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0sendfile\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0tcp_nopush\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0tcp_nodelay\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0keepalive_timeout\u00a0\u00a030;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0access_log\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 off; <\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0tcp_nopush\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0tcp_nodelay\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0reset_timedout_connection on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0client_body_timeout 10;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0send_timeout 2;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0keepalive_requests 100000;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0open_file_cache max=200000 inactive=20s;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0open_file_cache_valid 30s;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0open_file_cache_min_uses 2;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0open_file_cache_errors on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span><\/pre>\n<h2 style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Gzip compression<\/span><\/h2>\n<div><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Gzip can help reduce the amount of transmission over the network that Nginx works with. However, be careful increasing the level of gzip_comp_level too high as the server will start wasting CPU cycles.<\/span><\/div>\n<div><\/div>\n<div>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">http {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0gzip on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0gzip_disable msie6;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0gzip_vary on;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0gzip_proxied any;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0gzip_comp_level 6;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0gzip_buffers 32 16k;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0gzip_min_length 250;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0gzip_types image\/jpeg image\/bmp image\/svg+xml text\/plain text\/css application\/json application\/javascript application\/x-javascript text\/xml application\/xml application\/xml+rss text\/javascript image\/x-icon;<\/span><\/pre>\n<h2 style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Caching<\/span><\/h2>\n<div>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">An easy way to avoid processing your server\u2019s requests is if the clients think their content has already been updated.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To do this, you will need to set headers suitable for the cache, and a simple way to do this is to declare the necessary content and are fixed for a certain period of time:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">server {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0location \/ {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0...<\/span>\n  <span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span>\n  <span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0location ~* \\.(jpg|jpeg|png|gif|ico|xml)$ {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0expires 30d;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0location ~* \\.(css|js)$ {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0expires 7d;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0}<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span><\/pre>\n<div>\n<h2 id=\"id-06.\u0422\u044e\u043d\u0438\u043d\u0433\u0441\u0435\u0440\u0432\u0435\u0440\u0430NGINX-HTTP\/2Support\" style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">HTTP\/2 Support<\/span><\/h2>\n<p><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">HTTP\/2 has many advantages over HTTP, for example, it allows the browser to download files in parallel and allows the server to load resources, among other things. All you have to do is replace http with http2 in your server block by default<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">server{<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">listen 443 http2 default_server;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0listen [::]:443 http2 default_server;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0server_name example.com;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span><\/pre>\n<div>\n<h2 id=\"id-06.\u0422\u044e\u043d\u0438\u043d\u0433\u0441\u0435\u0440\u0432\u0435\u0440\u0430NGINX-RedirectWWW\" style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Redirect WWW<\/span><\/h2>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">server {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">server {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0listen 80;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0listen [::]:80;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0server_name example.com;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0return 301 https:\/\/$server_name$request_uri;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">server {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0listen 80;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0listen [::]:80;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0listen 443 ssl http2;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0listen [::]:443 ssl http2;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0server_name www.example.com;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0return 301 https:\/\/example.com$request_uri;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span><\/pre>\n<h2 style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Simple DDoS protection<\/span><\/h2>\n<div><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">This is far from secure DDoS protection, but it can slow down some small DDoS.<\/span><\/div>\n<div>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">http {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> . . .<\/span>\n<em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># limit the number of connections per IP<\/span><\/em>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;\n<\/span>\n<em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># limit the number of requests for this session<\/span><\/em>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=10r\/s;\n<\/span>\n<em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># the zone we want to limit to the upper values, we want to limit the entire server<\/span><\/em>\n\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">server {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0limit_conn conn_limit_per_ip 20;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0\u00a0limit_req zone=req_limit_per_ip burst=20 nodelay;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}\n<\/span>\n<em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># if the request body size is larger than the buffer size, then the full (or partial) request body is written to a temporary file\n<\/span><\/em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">client_body_buffer_size\u00a0 128k;\n<\/span>\n<em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># buffer size for reading client request header<\/span><\/em>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">client_header_buffer_size 3m;\n<\/span>\n<em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># maximum number and size of buffers for large headers to read from client request<\/span><\/em>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">large_client_header_buffers 4 256k;\n<\/span>\n<em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># body of the request timeout from the client<\/span><\/em>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">client_body_timeout\u00a0\u00a0 3m;\n<\/span>\n<em><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># how long to wait for the client to send the request header<\/span><\/em>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">client_header_timeout 3m;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span><\/pre>\n<h2 style=\"text-align: center;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">Improve security<\/span><\/h2>\n<div><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">By default, your NGINX does not have all the necessary security headers, which is actually quite simple. They prevent click attacks, crossite scripting, and other code attacks.<\/span><\/div>\n<div>\n<pre><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">http {<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0 <\/span><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">add_header X-Frame-Options \"SAMEORIGIN\" always;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0add_header X-XSS-Protection \"1; mode=block\" always;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0add_header X-Content-Type-Options \"nosniff\" always;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0add_header Referrer-Policy \"no-referrer-when-downgrade\" always;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0add_header Content-Security-Policy \"default-src * data: 'unsafe-eval' 'unsafe-inline'\" always;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"> \u00a0\u00a0add_header Strict-Transport-Security \"max-age=31536000; includeSubDomains; preload\" always;<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">...<\/span>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">}<\/span><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Setup worker_processes The architecture of the Nginx master and worker processes is explained as follows: &#8220;nginx has one master process and several worker processes. The main goal of the master process is to read and evaluate the configuration, as well as support worker processes. Worker processes actually handle requests. Nginx uses an event-based model and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[158],"tags":[95,547],"class_list":["post-7709","post","type-post","status-publish","format-standard","hentry","category-dedicated-servers","tag-nginx","tag-tuning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tuning NGINX for Performance - Unihost.FAQ<\/title>\n<meta name=\"description\" content=\"The main goal of the master process is to read and evaluate the configuration, as well as support worker processes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tuning NGINX for Performance - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"The main goal of the master process is to read and evaluate the configuration, as well as support worker processes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-25T11:59:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-09T14:03:26+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/unihost.com\/help\/wp-content\/uploads\/NGINX-logo.png\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"Tuning NGINX for Performance\",\"datePublished\":\"2020-02-25T11:59:20+00:00\",\"dateModified\":\"2023-10-09T14:03:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/\"},\"wordCount\":385,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/unihost.com\/help\/wp-content\/uploads\/NGINX-logo.png\",\"keywords\":[\"Nginx\",\"tuning\"],\"articleSection\":[\"02. Dedicated servers\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/\",\"url\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/\",\"name\":\"Tuning NGINX for Performance - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/unihost.com\/help\/wp-content\/uploads\/NGINX-logo.png\",\"datePublished\":\"2020-02-25T11:59:20+00:00\",\"dateModified\":\"2023-10-09T14:03:26+00:00\",\"description\":\"The main goal of the master process is to read and evaluate the configuration, as well as support worker processes.\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#primaryimage\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?.\/NGINX-logo.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?.\/NGINX-logo.png\",\"width\":1921,\"height\":645},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Tuning NGINX for Performance\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/#website\",\"url\":\"https:\/\/unihost.com\/help\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tuning NGINX for Performance - Unihost.FAQ","description":"The main goal of the master process is to read and evaluate the configuration, as well as support worker processes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/","og_locale":"en_US","og_type":"article","og_title":"Tuning NGINX for Performance - Unihost.FAQ","og_description":"The main goal of the master process is to read and evaluate the configuration, as well as support worker processes.","og_url":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2020-02-25T11:59:20+00:00","article_modified_time":"2023-10-09T14:03:26+00:00","og_image":[{"url":"http:\/\/unihost.com\/help\/wp-content\/uploads\/NGINX-logo.png","type":"","width":"","height":""}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"Tuning NGINX for Performance","datePublished":"2020-02-25T11:59:20+00:00","dateModified":"2023-10-09T14:03:26+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/"},"wordCount":385,"publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"image":{"@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#primaryimage"},"thumbnailUrl":"http:\/\/unihost.com\/help\/wp-content\/uploads\/NGINX-logo.png","keywords":["Nginx","tuning"],"articleSection":["02. Dedicated servers"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/","url":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/","name":"Tuning NGINX for Performance - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#primaryimage"},"image":{"@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#primaryimage"},"thumbnailUrl":"http:\/\/unihost.com\/help\/wp-content\/uploads\/NGINX-logo.png","datePublished":"2020-02-25T11:59:20+00:00","dateModified":"2023-10-09T14:03:26+00:00","description":"The main goal of the master process is to read and evaluate the configuration, as well as support worker processes.","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#primaryimage","url":"https:\/\/unihost.com\/help\/minio.php?.\/NGINX-logo.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?.\/NGINX-logo.png","width":1921,"height":645},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/tuning-nginx-for-performance\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/"},{"@type":"ListItem","position":3,"name":"Tuning NGINX for Performance"}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/#website","url":"https:\/\/unihost.com\/help\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/comments?post=7709"}],"version-history":[{"count":5,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7709\/revisions"}],"predecessor-version":[{"id":16357,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7709\/revisions\/16357"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/media?parent=7709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/categories?post=7709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/tags?post=7709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}