I stumbled over the same thing, but alas, at a state, where I already had several thousand lines of code arround my service frame ;o(
The sockets do not really make balancing, they "round robin" through all connected servers. When I asked about this (here), I got this REALLY helpful link: http://zguide.zeromq.org/chapter:all#toc45
It describes (in C), how to build up a concept, where servers fetch their work themselves instead of getting it thrown into the letter box. I looks a bit complicated at the first glance, but if you work through the LRU-code, it's pretty easy at the end.
I read for one day, and in one more, I had the whole stuff switched to this way of message flow. And you won't believe it: it worked from the first compilation ;o))))
When you kill a server while the clients waits for it's reply, you're lost in any way. To catch this, you have to implement timeouts.
^ 5
Sven
---------------------------------------------------------
E = mc² ± 2dBA ----- everything is relative
---------------------------------------------------------
-----Original Message-----
Date: Thu, 28 Oct 2010 16:55:01 +0200
Subject: [zeromq-dev] Load balancing REQ/REP is blocked when a server dies
From: Jaime Fernández <jjja...@gmail.com>
To: zeromq-dev@lists.zeromq.org
I'm starting with zmq and I try to implement a system where a
client communicates with one of the available servers by balancing the
load.
I've modified the client and server
available at:
so that the client connects to two different
servers:
socket.connect
("tcp://localhost:5555")
socket.connect
("tcp://localhost:5556")
However, when I kill one of the servers, the client blocks
forever.
Is it a bug of the Python binding?
Is there any mechanism or best practice to avoid the
effect?
Thanks in
advance,
Jaime
_______________________________________________ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev