1/*
2 Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
3
4 This file is part of libzmq, the ZeroMQ core engine in C++.
5
6 libzmq is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License (LGPL) as published
8 by the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 As a special exception, the Contributors give you permission to link
12 this library with independent modules to produce an executable,
13 regardless of the license terms of these independent modules, and to
14 copy and distribute the resulting executable under terms of your choice,
15 provided that you also meet, for each linked independent module, the
16 terms and conditions of the license of that module. An independent
17 module is a module which is not derived from or based on this library.
18 If you modify this library, you must extend this exception to your
19 version of the library.
20
21 libzmq is distributed in the hope that it will be useful, but WITHOUT
22 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
24 License for more details.
25
26 You should have received a copy of the GNU Lesser General Public License
27 along with this program. If not, see <http://www.gnu.org/licenses/>.
28*/
29
30#ifndef __ZMQ_CONFIG_HPP_INCLUDED__
31#define __ZMQ_CONFIG_HPP_INCLUDED__
32
33namespace zmq
34{
35// Compile-time settings.
36
37enum
38{
39 // Number of new messages in message pipe needed to trigger new memory
40 // allocation. Setting this parameter to 256 decreases the impact of
41 // memory allocation by approximately 99.6%
42 message_pipe_granularity = 256,
43
44 // Commands in pipe per allocation event.
45 command_pipe_granularity = 16,
46
47 // Determines how often does socket poll for new commands when it
48 // still has unprocessed messages to handle. Thus, if it is set to 100,
49 // socket will process 100 inbound messages before doing the poll.
50 // If there are no unprocessed messages available, poll is done
51 // immediately. Decreasing the value trades overall latency for more
52 // real-time behaviour (less latency peaks).
53 inbound_poll_rate = 100,
54
55 // Maximal delta between high and low watermark.
56 max_wm_delta = 1024,
57
58 // Maximum number of events the I/O thread can process in one go.
59 max_io_events = 256,
60
61 // Maximal batch size of packets forwarded by a ZMQ proxy.
62 // Increasing this value improves throughput at the expense of
63 // latency and fairness.
64 proxy_burst_size = 1000,
65
66 // Maximal delay to process command in API thread (in CPU ticks).
67 // 3,000,000 ticks equals to 1 - 2 milliseconds on current CPUs.
68 // Note that delay is only applied when there is continuous stream of
69 // messages to process. If not so, commands are processed immediately.
70 max_command_delay = 3000000,
71
72 // Low-precision clock precision in CPU ticks. 1ms. Value of 1000000
73 // should be OK for CPU frequencies above 1GHz. If should work
74 // reasonably well for CPU frequencies above 500MHz. For lower CPU
75 // frequencies you may consider lowering this value to get best
76 // possible latencies.
77 clock_precision = 1000000,
78
79 // On some OSes the signaler has to be emulated using a TCP
80 // connection. In such cases following port is used.
81 // If 0, it lets the OS choose a free port without requiring use of a
82 // global mutex. The original implementation of a Windows signaler
83 // socket used port 5905 instead of letting the OS choose a free port.
84 // https://github.com/zeromq/libzmq/issues/1542
85 signaler_port = 0
86};
87}
88
89#endif
90