August 2017
Intermediate to advanced
278 pages
8h 53m
English
By adding the keepalive directive, we define the maximum number of idle connections to keep open using keep alives. In our recipe, we specified a maximum of eight idle connections. It's important to note that this isn't the maximum number of connections in total, this only defines the number of idle connections to keep open.
We can confirm that keepalive is working by checking the connections from the NGINX server. To do this, we use the ss command with the -o flag to display timer information in relation to the socket. For example, we can run the following command:
ss -tpno
With our Express-based demo, you should see something like the following:
State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 0 127.0.0.1:3000 ...
Read now
Unlock full access