Mastering Nginx

(Ron) #1

Troubleshooting Techniques


[ 210 ]

Network limits


If you find yourself in a situation in which no network buffers are available, you


will most likely only be able to log in at the console, if at all. This can happen when
NGINX receives so many client connections that all available network buffers are


used up. Increasing the number of network buffers is also specific to a particular
operating system and may be done as follows:



  • FreeBSD
    vi /boot/loader.conf


kern.ipc.nmbclusters=262144


  • Solaris

    ndd -set /dev/tcp tcp_max_buf 16777216




When NGINX is acting as either a mail or an HTTP proxy, it will need to open many
connections to its upstream servers. To enable as many connections as possible, the


ephemeral TCP port range should be adjusted to its maximum.



  • Linux
    vi /etc/sysctl.conf


net.ipv4.ip_local_port_range = 1024 65535
# sysctl -p /etc/sysctl.conf


  • FreeBSD
    vi /etc/sysctl.conf


net.inet.ip.portrange.first=1024
net.inet.ip.portrange.last=65535
# /etc/rc.d/sysctl reload


  • Solaris

    ndd -set /dev/tcp tcp_smallest_anon_port 1024


    ndd -set /dev/tcp tcp_largest_anon_port 65535




Having adjusted these basic values, we will now take a look at more specific


performance-related parameters in the next section.

Free download pdf