Reading Node's doc about server.keepAliveTimeout:
If the server receives new data before the keep-alive timeout has fired, it will reset the regular inactivity timeout, i.e., server.timeout.
How is that different from server.timeout?
It sounds like they are both about socket timeout which only start to tick on inactivity.
Keep-Alive
is a header part of the Http Protocol. The Keep-Alive
header will allow multiple Http Requests to be send over a single connection instead of using multiple.
So setting the keepAliveTimeout
will decide how long these Keep-Alive
connections are allowed to stay open. The timeout
decides the maximum amount of time the server will wait for a client's response.
more info about Keep-Alive
can be found here: https://blog.stackpath.com/glossary-keep-alive/
server.timeout
is time (in ms) of inactivity allowed once request received ( need not set always , default is 5 mins )
server.keepAliveTimeout
is time (in ms) server will wait and keep the connection open after last response. ( need not set always , default is 5sec )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With