5 ms·
Unless of course you have a high bounce rate (intended or otherwise) never use HTTP keep-alive.
by msantos 12y ago
Unless of course you have a high bounce rate (intended or otherwise) never use HTTP keep-alive.
- acdha 12y agoCan you provide some background on when and why you believe this is good advice? Otherwise this is exactly the kind of technical folklore the original post was complaining about – it's a broad assertion with no supporting theory to help people understand whether it's applicable to their situation.
- joosters 12y agoI think they're trying to say that if someone is likely to make just the one connection to your site, and then never fetch further pages, then you don't want to turn keep-alive on. There would be no point maintaining the connection if the client isn't likely to use it. Imagine you run a site that provided a common javascript library. People are encouraged to add a link to fetch the .js file from their 3rd party webpages. So most clients contacting your server will be there to fetch one file only. Even if the user continues to browse the 3rd party website, they won't make further requests to your server. One connection, one request. Here, keepalives would be a bad idea.
- acdha 12y agoI'm pretty sure the explanation is something like that but I felt the sloppy wording and completely lack of any explanation was exactly the kind of thing we need less of in tech advice, particularly when describing an extreme edge-case. The original wording was poor enough that it's ambiguous whether the claim is “enable keepalive unless you have a high bounce rate” or “enable keepalive if you have a high bounce rate”.
- msantos 12y agoI meant do NOT use keep-alive if you have a high bounce rate. High traffic and high bounce rate, will leave a lot of TIME_WAIT hanging around for precious seconds and soon enough your server won't be able to accept new connections. Obviously this applies if you have both: high traffic and high bounce rate. Any high traffic service over TCP where a client connects to the server for a very brief moment and doesn't come back until hours or days later, or never.
- acdha 12y agoThese are exactly the missing details, modulo the qualifier that "high traffic" generally means at least tens of thousands of persistent connections on a modern web server.
- sokoloff 12y agoI think you mean the opposite advice of the natural reading of your text. I read your advice as "Only use HTTP keep-alive if you have a high bounce rate", when I presume you mean the opposite. 1. Unless P, then Q. 2. P is "have a high bounce rate" 3. Q is "do not use keep alives" I think you meant: 1. If P, then Q. 2. P and Q same as above.
- msantos 12y agoYes, I meant do NOT use keep-alive if you have a high bounce rate.
- msantos 12y agoCan't edit the above post, but what I meant was: do NOT use keep-alive if you have a high bounce rate. Apologies for the poor wording.