From f90c8d957ea2a11c73a307aae2494a26d22c2f3b Mon Sep 17 00:00:00 2001 From: Martin Lucina Date: Fri, 8 Oct 2010 17:49:40 +0200 Subject: Scalability improvements for large amounts of connections Add signaler_sndbuf_size option to config.hpp which allows the user to increase the size of the send buffer used by the signalling socketpair. Implement random backoff for reconnection attempts using a primitive pseudo-random generation to prevent reconnection storms. Add wait_before_connect option to config.hpp to allow the user to enable random delay even on initial connect. Default is false for low latency. Signed-off-by: Martin Lucina --- src/config.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/config.hpp') diff --git a/src/config.hpp b/src/config.hpp index 57c2373..0d24d40 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -39,6 +39,10 @@ namespace zmq // using a single system call. signal_buffer_size = 8, + // Socketpair send buffer size used by signaler. The default value of + // zero means leave it at the system default. + signaler_sndbuf_size = 0, + // Determines how often does socket poll for new commands when it // still has unprocessed messages to handle. Thus, if it is set to 100, // socket will process 100 inbound messages before doing the poll. @@ -72,6 +76,9 @@ namespace zmq // How long to wait (milliseconds) till reattempting to connect. reconnect_period = 100, + // Should initial connection attempts be delayed? + wait_before_connect = false, + // Maximal delay to process command in API thread (in CPU ticks). // 3,000,000 ticks equals to 1 - 2 milliseconds on current CPUs. // Note that delay is only applied when there is continuous stream of @@ -87,7 +94,7 @@ namespace zmq // Maximal number of non-accepted connections that can be held by // TCP listener object. - tcp_connection_backlog = 10, + tcp_connection_backlog = 100, // Maximum transport data unit size for PGM (TPDU). pgm_max_tpdu = 1500 -- cgit v1.2.3