• Pieter Hintjens's avatar
    Problem: Windows 7 TCP slow start · 54e2e2a7
    Pieter Hintjens authored
    See issue #1608.
    
    This is an old issue with Windows 7. The effect is that we see a latency
    ramp on the first 500 messages.
    
    * The ramp is unaffected by message size.
    * Sleeping up to 100msec between sends has no effect except to switch
        off ZeroMQ batching so making the ramp more visible.
    * After 500 messages, latency falls back down to ~10-40 usec.
    * Over inproc:// the ramp happens when we use the signaler class.
    * Client-server over inproc:// does not show the ramp.
    * Client-server over tcp:// shows a similar ramp.
    
    We know that the signaller is using TCP on Windows. We can 'prime' the
    connection by doing 500 dummy sends. This potentially causes new sockets
    to be delayed on creation, which is not a good solution.
    
    Note that the signaller sends zero-byte messages. This may also be
    confusing TCP.
    
    Solution: flood the receive buffer when creating a new FD pair; send a
    1M buffer and discard it.
    
    Fixes #1608
    54e2e2a7
signaler.cpp 19.1 KB