eocene
2014-04-10 17:05:44 UTC
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.
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.