hmbdc
simplify-high-performance-messaging-programming
DefaultUserConfig.hpp
1 #include "hmbdc/Copyright.hpp"
2 #pragma once
3 
4 namespace hmbdc { namespace app { namespace tcpcast {
5 /**
6  * the send and recv engine config parameters and its default values used in this module
7  * each module comes with a performance tool (perf-xxxx) that the user could experiment each of the
8  * following settings on a hardware environment
9  */
10 char const* const DefaultUserConfig = R"|(
11 {
12  "ifaceAddr" : "0.0.0.0/0", "__ifaceAddr" :"ip address for the NIC interface for IO, 0.0.0.0/0 pointing to the first intereface that is not a loopback",
13  "loopback" : false, "__loopback" :"set this to true if processes within the same host need to communicate using rmcast not effective when using loopback interface (127.0.0.1.",
14  "mcastAddr" : "232.43.211.235", "__mcastAddr" :"multicast address for topic related IO",
15  "mcastPort" : 4321, "__mcastPort" :"multicast port to for topic related IO",
16  "schedPolicy" : "SCHED_OTHER", "__schedPolicy" :"engine thread schedule policy - check man page for allowed values",
17  "schedPriority" : 0, "__schedPriority" :"engine thread schedule priority - check man page for allowed values",
18  "tx" :
19  {
20  "hmbdcName" : "tcpcast-tx", "__hmbdcName" :"engine thread name",
21  "maxSendBatch" : 60, "__maxSendBatch" :"up to how many messages to send in a batch (within one udp packet)",
22  "minRecvToStart" : 1, "__minRecvToStart" :"start send when there are that many recipients (processes) online, otherwise hold the message in buffer - NOTE: buffer might get full and blocking",
23  "mtu" : 1500, "__mtu" :"mtu, check ifconfig output for this value for each NIC in use",
24  "nagling" : false, "__nagling" :"should the tcp channel do nagling",
25  "outBufferSizePower2" : 0, "__outBufferSizePower2" :"2^outBufferSizePower2 is the number of message that can be buffered in the engine, default 0 means automatically calculated based on 128KB as the low bound",
26  "sendBytesBurst" : 0, "__sendBytesBurst" :"rate control for how many bytes can be sent in a burst, us the OS buffer size (131071) as reference, 0 means no rate control.",
27  "sendBytesPerSec" : 100000000, "__sendBytesPerSec" :"rate control for how many bytes per second - it is turned off by sendBytesBurst==0",
28  "tcpPort" : 0, "__tcpPort" :"tcp port number used when send messages out - 0 means let the OS pick",
29  "tcpSendBufferBytes" : 0, "__tcpSendBufferBytes" :"OS buffer byte size for outgoing tcp, 0 means OS default value",
30  "topicAdvertisePeriodSeconds" : 1, "__topicAdvertisePeriodSeconds" :"send engine advertise the topics it covers every so often",
31  "topicRegex" : ".*", "__topicRegex" :"the topic regex pattern this send engine covers, there shall NOT be an overlap of this pattern between differt send engines in the NetContext, otherwise the first engine is used",
32  "ttl" : 1, "__ttl" :"the switch hop number",
33  "udpSendBufferBytes" : 0, "__udpSendBufferBytes" :"OS buffer byte size for outgoing udp, 0 means OS default value",
34  "waitForSlowReceivers" : true, "__waitForSlowReceivers" :"when true, a slow receiver on the network subscribe to the message might slow down (even block) the sender and other recv engines since the sender needs to wait for it; when false, the slow receiver would be disconnected when it is detected to be slow. in that case the receiver will receive a disconnect message and it by default will reconnect. some messages could be lost before the reconnection is done."
35  },
36  "rx" :
37  {
38  "additionalTopicSources" : [], "__additionalTopicSources" :"when multicast is not available, the user can explicitly specify the sender info (ip, port, topicRegex) here, for example [\"127.0.0.1 3241 topic_regex1\", \"192.168.0.1 3241 my_topic\"]",
39  "additionalTopicSourcesScanPeriodSeconds" : 1, "__additionalTopicSourcesScanPeriodSeconds" :"when the user explicitly specify the sender info, the senders are scanned/tried every so often",
40  "allowRecvMemoryAttachment" : "", "__allowRecvMemoryAttachment" :"what memory attachment messages (space separated typeTag's) the recv engine accepts. those memory attached message NEEDS to be consumed and the user code is responsible for releasing the attachment memory when it is consumed to avoid memory leak. - if not listed, those messages are still delivered but with INVALID attachment ptrs.",
41  "cmdBufferSizePower2" : 10, "__cmdBufferSizePower2" :"2^cmdBufferSizePower2 is the engine command buffer size - rarely need to change",
42  "heartbeatPeriodSeconds" : 1, "__heartbeatPeriodSeconds" :"the recv heart beat every so often so the send side know it is alive",
43  "hmbdcName" : "tcpcast-rx", "__hmbdcName" :"thread name",
44  "maxTcpReadBytes" : 131072, "__maxTcpReadBytes" :"up to how many bytes to read in from the backup channel each time",
45  "tcpRecvBufferBytes" : 0, "__tcpRecvBufferBytes" :"OS buffer byte size for incoming tcp, 0 means OS default value",
46  "udpRecvBufferBytes" : 0, "__udpRecvBufferBytes" :"OS buffer byte size for incoming udp, 0 means OS default value"
47  }
48 }
49 )|";
50 }}}
51 
char const *const DefaultUserConfig
Definition: DefaultUserConfig.hpp:10
Definition: Base.hpp:12