Discussion:
HTTP persistent connections / keep-alive
eocene
2014-04-10 17:05:44 UTC
Permalink
I have been experimenting with persistent connections for http, and
wanted to see what your thoughts were.

This has been working well enough for me:
http://flpsed.org/hgweb/eocene_persistent_connections/

Why? To be a good internet citizen, tcp slow-start, etc.

Johannes gave it a try and said it performed well.

Initially I let FDs stick around even if I didn't immediately have
new queries for them. When the server closed it, I'd get EPIPE on
the write side and... I think it was ECONNRESET on the read side,
send the OpEnd around ccc, and that worked all right and wasn't too
messy. But then I wanted to handle the case where a FD sits idle and
we try to reuse it and it fails. Sending the notifications around and
getting everything back in a state where we could try again with a
new connection was looking like it would be very messy.

So I trimmed it all down so that, when we have our full reply, we
reuse the FD if we already have something queued that can use it,
and if not we just close the connection.
eocene
2014-07-12 02:03:23 UTC
Permalink
Post by eocene
I have been experimenting with persistent connections for http, and
wanted to see what your thoughts were.
http://flpsed.org/hgweb/eocene_persistent_connections/
Why? To be a good internet citizen, tcp slow-start, etc.
Johannes gave it a try and said it performed well.
[snip]

So I've been using it for three months and I like it. I haven't
noticed any problems with it, and I'm planning to merge it in next
week -- maybe around the 17th.

To enjoy persistent connections, you would have to put
http_persistent_conns=YES
in dillorc.

Loading...