Multiplexing a a large number of front-end connections among a few back-end connections

Hello,

I have a scenario where an NGINX instance is holding persistent HTTP
connections from 50,000 clients. Sporadic requests from these clients
have to be multiplexed over a few socket connections to back-end servers
over a different binary protocol.

Is it possible to write a module to do this. i.e., incorporate the
non-HTTP upstream sockets in NGINX’s main event loop? And proxy the
requests and responses via an id I supply between the HTTP client and
the non-HTTP back-end? The few back-end connections are multiplexed,
bi-directional and support out-of-band messaging.

I have tried googling for this and am unable to figure out a way to do
this.

Regards,
Amit

Posted at Nginx Forum: