Hi Frédéric,
I don't understand your question actually. Zerogw supports multiple
simultaneous requests from the first version having a working HTTP
(say v0.1 :) ). But, I'll try to guess what you mean:
1. Client side requests are received simultaneously up to the limit of
max-connections and max-requests and listen-backlog and file
descriptor limit. I don't think you reached that limit (if you do,
just lift up the limits)
2. Client side requests are not being streamed until whole POST body
is downloaded into zerogw's memory. If you are trying very large
files, and you expect to see the request at backend immediately, it
may not be the case. You have to wait until whole post body will be
uploaded before it reaches the backend, be it first request or any
other one.
3. If you use REP socket at the backend, you can process only one
request at a time. It's the limitation of zeromq REP sockets. You have
3 options: use XREP (ROUTER) socket, connect multiple zeromq sockets
to zerogw, start multiple processes for backend.
4. The load-balancing for zeromq REQ/REP sockets is not guaranteed to
be fair. Consider the following situation. You started single backend
worker, it got two requests queued, but still processes first one.
Then you spawn another worker, the latter will process new requests,
ones that are already queued in the first worker will be queued there
forever. After the second worker is started, both will get same number
of requests (without accounting that first one is more loaded). This
can be smoothed a bit by setting high water marks on zeromq sockets.
5. If you confused that zerogw declares `!zmq.Req` socket in config,
don't believe :) It's actually XREQ (DEALER) socket, just we consider
that an implementation detail.
6. You man have `!zmq.Connect` socket in zerogw. Just either change it
to `!zmq.Bind` or put multiple `!zmq.Connect` lines to configuration
file to connect pool of workers.
All in all, you may run `zerogw -c examples/zerogw.yaml` and few
instances of `python2.7 examples/echo.py` and see what happens. Put a
sleep call and more print statements to see what happens
simultaneously and what not.
Unless you are trying to saturate 10Gbit you shouldn't have to worry
about multiple zerogw instances.
--
Paul