Skip to content

Instantly share code, notes, and snippets.

@kumaraswins
Last active May 31, 2019 23:55
Show Gist options
  • Save kumaraswins/d7b5554c7079113f08e0fdf38401e055 to your computer and use it in GitHub Desktop.
Save kumaraswins/d7b5554c7079113f08e0fdf38401e055 to your computer and use it in GitHub Desktop.

Revisions

  1. AswinKumar renamed this gist May 31, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. AswinKumar revised this gist May 31, 2019. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions nginx conf
    Original file line number Diff line number Diff line change
    @@ -12,3 +12,15 @@ then you may increase worker_processes to fully utilize disk bandwidth.
    The worker_connections and worker_processes from the main section allows you to calculate max clients you can handle:

    max clients = worker_processes * worker_connections


    worker_connections is the number of simultaneous connections; so they are simply stating how to calculate, for example:

    you are only running 1 process with 512 connections, you will only be able to serve 512 clients.

    If 2 processes with 512 connections each, you will be able to handle 2x512=1024 clients.

    The number of connections is limited by the maximum number of open files (RLIMIT_NOFILE) on your system



  3. AswinKumar revised this gist May 31, 2019. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions nginx conf
    Original file line number Diff line number Diff line change
    @@ -7,3 +7,8 @@ then you may set worker_processes to be equal to the number of CPUs or cores.

    If you are serving a lot of static files and the total size of the files is bigger than the available memory,
    then you may increase worker_processes to fully utilize disk bandwidth.


    The worker_connections and worker_processes from the main section allows you to calculate max clients you can handle:

    max clients = worker_processes * worker_connections
  4. AswinKumar revised this gist May 31, 2019. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions nginx conf
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@ worker_processes

    A worker process is a single-threaded process.

    If Nginx is doing CPU-intensive work such as SSL or gzipping and you have 2 or more CPUs/cores, then you may set worker_processes to be equal to the number of CPUs or cores.
    If Nginx is doing CPU-intensive work such as SSL or gzipping and you have 2 or more CPUs/cores,
    then you may set worker_processes to be equal to the number of CPUs or cores.

    If you are serving a lot of static files and the total size of the files is bigger than the available memory, then you may increase worker_processes to fully utilize disk bandwidth.
    If you are serving a lot of static files and the total size of the files is bigger than the available memory,
    then you may increase worker_processes to fully utilize disk bandwidth.
  5. AswinKumar created this gist May 31, 2019.
    7 changes: 7 additions & 0 deletions nginx conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    worker_processes

    A worker process is a single-threaded process.

    If Nginx is doing CPU-intensive work such as SSL or gzipping and you have 2 or more CPUs/cores, then you may set worker_processes to be equal to the number of CPUs or cores.

    If you are serving a lot of static files and the total size of the files is bigger than the available memory, then you may increase worker_processes to fully utilize disk bandwidth.