Why is it lost?
In ZeroMQ v2.1, the default value for ZMQ_HWM was INF (infinity), which helped the specified test to be somewhat significant, but with a high degree of risk, an overflow failure, because the buffer allocation policy was not limited / controlled to cause any physical limit.
From ZeroMQ v3.0 +, ZMQ_SNDHWM / ZMQ_RCVHWM by default to 1000, which can be installed later.
You can also read the explicit warning that
ØMQ does not guarantee that the socket will accept as many ZMQ_SNDHWM messages, and the actual limit may be 60-70% lower depending on the message flow in the socket.
Will there be a separation of the transmitting / receiving part into separate streams ??
Not.
Quick fix?
Yes, for demonstration experiments, set the endless high water signs again, but be careful to avoid this practice in any production-grade software.
Why test the performance of ZeroMQ this way?
As stated above, the initial demo test seems to have some significance in the v2.1 implementation.
Since those days, ZeroMQ has changed a lot. A very enjoyable reading for your particular interest regarding performance envelopes, which may help you understand this domain, is in the walkthrough with code examples in the ZeroMQ protocol overhead / performance evaluation for large file transfers
... we already have a problem: if we send too much data to the ROUTER socket, we can easily overflow it. A simple but stupid solution is to put an endless high water mark in the nest. This is stupid, because now we have no protection against running out of server memory. However, without endless HWM, we risk losing pieces of large files.
Try this: set the HWM to 1000 (in ZeroMQ v3.x this is the default), and then reduce the block size to 100K so that we send 10 thousand pieces at a time. Run the test and you will see that it never ends. According to the zmq_socket () man page with hilarious brutality, for the ROUTER socket: "ZMQ_HWM: Drop option action."
We must control the amount of data sent by the server. There is no point in sending more than the network can work. Try sending one piece at a time. In this version of the protocol, the client will explicitly say, “Give me chunk N,” and the server will select that particular fragment from disk and send it.
The best part, as far as I know, is the commented progress of the resulting performance in the "model 3" flow control, and you can learn a lot from the wonderful chapters and real notes in the ZeroMQ manual.