lua-http icon indicating copy to clipboard operation
lua-http copied to clipboard

Client connection pooling

Open daurnimator opened this issue 9 years ago • 1 comments

Should probably be done at the http.client level?

Need a 'multi-key' cache structure that allows us to index by a tuple of host, port, version, tls context, etc.

Need a way to know when connection is unused to add it back to a pool. EDIT: Now have connection:onidle

Misc things:

  • When grabbing a http2 connection from the pool, may need to update settings.
  • connections can be shared: http2 should be by default; but don't do http1 pipelining by default.
  • Interaction with proxys?
  • Should allow multiple connections per tuple
    • low and high water marks?
  • tie expiry of connection to expiry of cert? expiry of dns entry?

daurnimator avatar Feb 13 '16 11:02 daurnimator

Curl's implementation:

  • Most parameters: https://github.com/curl/curl/blob/f8be737d8f5276a6ab4c9560d896fb5585d2933e/lib/url.c#L1101
  • SSL parameters:https://github.com/curl/curl/blob/f8be737d8f5276a6ab4c9560d896fb5585d2933e/lib/vtls/vtls.c#L86

daurnimator avatar Jul 13 '18 04:07 daurnimator