Question for MultiProcess architecture integration
Closed this issue · 1 comments
Hi,
Can an application which has multiple process make use of "libuinet" (the user space TCP stack) ?
For example, I am thinking if I can integrate Nginx (which works as revere proxy) with libuinet. As you might know, in Nginx we have master process which creates several worker process. The master process creates the listen socket (to receive the requests from the clients) and all the worker listens to that socket and the synchronization is achieved through the mutex. Once a worker process accepts a connection from the client, it talks to the backend webs servers directly. So, I am wondering if the the
libuinet can work with a multiprocess application or it only works with multi threaded applications?
Any pointers how it can work with multi process applications?
Thanks...Peter
I am not currently familiar with the internal details of Nginx, but it sounds like what you are talking about is multiple child processes sharing a listen socket file descriptor via their parent. That sort of thing works because the TCP/IP stack state and access synchronization mechanism is in the kernel. This model is not supported by libuinet because all of the libuinet TCP/IP stack state associated with a given network interface is in userland in one process, and building a mechanism to efficiently emulate it isn't on the libuinet roadmap.
libuinet is intended for scaling via multi-threading within one process, or multiple instances of libuinet in separate processes each owning its own set of network interfaces (the concept of network interfaces here is really virtual - you can create whatever packet/flow steering layer underneath libuinet to feed multiple processes if you like).