On Fri, May 27, 2016 at 11:49 PM, Yichun Zhang (agentzh) <age...@gmail.com>
wrote:
> Hello!
>
> On Mon, May 23, 2016 at 9:48 AM, Flavien L wrote:
> > I'd like to share this connection pool across workers/threads. Is that
> > possible ?
> >
>
> Nope. That would be too expensive to pass connections across the
> process boundary.
>
Depends on what you compare it to ! ;o) (see below).
> > I can mitigate the cost of tcp connections adding a local proxy in
> between
> > but I'd like to avoid that.
>
My LUA script is some sort of smart proxy for HTTP requests : Depending on
configuration and request type/content, it rewrites some parts, adds
headers, removes some, sends requests to different machines, analyzes the
results, etc.
The problem I have is that establishing connections to remote hosts is
costly as they are in a different DC. Therefore, I really do need to use
keepalive between the host that runs my smart proxy and the remote hosts.
For each request that is received, a lua context is created and the
cosockets that I create in the script are closed when the script exits.