Score:0

What's the difference between Nginx 'keepalive_time' and 'keepalive_timeout'?

lb flag

In official Nginx docs a new directive added since v1.19.10 named keepalive_time 1h: Nginx keepalive_time Doc

Limits the maximum time during which requests can be processed through one keep-alive connection. After this time is reached, the connection is closed following the subsequent request processing.

Once a keep-alive connection initiates by browser, keepalive_timeout 75s limits the time during witch the next static HTTP request could be sent. After 75s, the keep-alive connection will be terminated. Now my question is, what will be happened after keepalive_time 1h? The connection already closed after 75 seconds! Does this mean that Nginx can execute a request witch has sent in a keep-alive connection for 1 hour?

Please simply describe the differences with an example as much as possible.

Richard Smith avatar
jp flag
Only an idle keep-alive connection is closed after 75s. If the connection remains active (i.e. the browser continues to make many requests) then it will be closed after 1h.
Mohamad Reza avatar
lb flag
@RichardSmith Did I understand correctly: Every keep-alive connection that receives a new request in less than 75 seconds frequently, will last up to one hour at max (by `keepalive_time 1h`). Of course, it is clear that if there is no request in 75 seconds, it will be closed by `keepalive_timeout 75s`
Richard Smith avatar
jp flag
That is my understanding from reading the documents.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.