• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

What's your best nginx.conf for better performance ?

Johan06

New Pleskian
Hello,

I'm just wondering what's your best optimization / tips for better performance in nginx.conf
Sure it depend of what you use (fpm, fastcgi, etc...)

I'm asking to compare and see what can I do in my own conf below :

Code:
#user  nginx;
worker_processes  auto;

#error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

#pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
    multi_accept on;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    client_header_timeout 3000;
    client_body_timeout 3000;
    client_max_body_size 32m;

    fastcgi_read_timeout 3000;
    fastcgi_send_timeout 3000;
    fastcgi_connect_timeout 3000;
    fastcgi_buffers 16 128k;
    fastcgi_buffer_size 128k;

    proxy_buffers 16 128k;
    proxy_buffer_size 128k;



    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    #tcp_nodelay        on;

    #gzip  on;
    #gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    gzip_comp_level 9;
    gzip_http_version 1.1;
    gzip_proxied any;
    gzip_min_length 10;
    gzip_buffers 16 8k;
    gzip_types text/plain text/css application/javascript text/xml application/xml application/xml+rss text/javascript application/xhtml+xml;

    # Disable for IE < 6 because there are some known problems
    gzip_disable “MSIE [1-6].(?!.*SV1)”;

    # Add a vary header for downstream proxies to avoid sending cached gzipped files to IE6
    gzip_vary on;

    server_tokens off;



    server {
        listen 80;
        index index.php index.html;

    }



    include /etc/nginx/conf.d/*.conf;
}

# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;
 
Hello,

Plesk Support does not provide any performance customizations for nginx and other services.

I can only suggest to make sure that you have increased worker_rlimit_nofile setting in case of huge amount of websites.
 
Ok, I just wondering what other user did with their own config. Like more a sharing experience than a support ask.

My server will contain 100 websites max.
How can I define the right number to use for worker_rlimit_nofile ?

Thanks for your suggestion.
 
@Alex@Odin

Thanks for the correction of your previous suggestion.

Setting or adjusting the modify worker_rlimit_nofile is often not necessary at all and, moreover, can be very dangerous in the presence of specific other Nginx or php related settings.

It is simply not the best way of tweaking performance and/or optimizing Nginx performance.

Regards....
 
@Alex@Odin

Thanks for the correction of your previous suggestion.

Setting or adjusting the modify worker_rlimit_nofile is often not necessary at all and, moreover, can be very dangerous in the presence of specific other Nginx or php related settings.

It is simply not the best way of tweaking performance and/or optimizing Nginx performance.

Regards....
It is required when default file limit is reached. This is related only for systems with huge amount of websites.
 
@Alex@Odin,

It is required when default file limit is reached. This is related only for systems with huge amount of websites.

The whole concept of tweaking performance and settings is to prevent such situations to be occurring. Again, a very dangerous comment from your side.

If you don´t want to hear it from me, please contact the Nginx Inc. team, they are happy to tell you all about the nature, history of and necessity for this particular directive.
 
Dear trialotto,

If you want to clarify this point, please contact me personally. This statement is taken from our service team, worker_rlimit_nofile should be modified to allow nginx to work properly with huge amount of domains if file limit is reached.
 
Back
Top