From nginx.org, the default value of keepalive config is —, however I don't quite understand what does this mean.
Syntax: keepalive connections;
Default: —
Context: upstream
This directive appeared in version 1.1.4.
From nginx.org, the default value of keepalive config is —, however I don't quite understand what does this mean.
Syntax: keepalive connections;
Default: —
Context: upstream
This directive appeared in version 1.1.4.
In order Nginx to keep TCP connection alive both upstream section and origin server should be configured to not finalise the connection. Upstream section keepalive default value means no keepalive, hence connection won't be reused, each time you can see TCP stream number increases per every request to origin server, opposite to what happens with keepalive. You can check it with using tcpdump.
10 Tips for 10x Application Performance blog post describes it very well:
See also RFC-793 Section 3.5:
Two examples, take a look on Application Data below.
Without keepalive:
With keepalive: