Table of Contents
In Chapter (See section ) we briefly explained how to build the library, in this chapter we will go into depth about how to customize the build options to tailor a optimal build for your particular use case.
All customization options listed in the following shall be added in your init.mk file.
Luaplugin support, defaults to 0, which disables
Luasupport. Set it to 1 will enable
Luaplugin support. Also remember to provide necessary
Clibrary and add to your
LDLIBSthe required compile and link flags, etc.
HTTP version, defaults to 1.1. Set it to 1.0 for environments when
HTTP/1.1is not supported.
Maximum receive buffer size for
SrNetSocket, defaults to 1024 bytes. This number dictates the maximum number of bytes the
SrNetSocketcan block waiting for response. This parameter only affects the receive buffer of
Polling interval for
SrAgent, defaults to 5 milliseconds. Internally
SrMsgHandlerby constantly polling for expired
SrTimerand arrived messages from ingress
SrQueue, this parameter dictates the interval between two consecutive polling. When is parameter is set too high, the agent may appear to be sluggish, whereas when set too low, many CPU cycles are wasted. This is a trade-off parameter that needs to be fine-tuned for any particular device.
Maximum number of aggregated requests, defaults to 512. For saving traffic use,
SrReporterhas a mechanism to aggregate many messages into one request and send them all in once. This number dictates the maximum number of messages that can be aggregated.
Maximum waiting time between two consecutive requests for aggregation, defaults to 400 milliseconds. When aggregating requests,
SrReporterwill wait for consecutive messages with a defined timeout. If the next messages comes after the timeout,
SrReporterwill stop the waiting loop and starts sending the already aggregated messages. When set to a higher number, higher aggregation can be expected, therefore, results in lower traffic use, whereas when set to a lower number, agent will be more responsive since it will not wait for aggregating next message. This is a trade-off parameter that needs to be fine-tuned for any particular use case.
Maximum number of retries when sending fails, defaults to 9 times. For counteracting temporary network failures,
SrReporterimplemented an exponential wait and multi-trials measure. When the first trial fails, it waits 1 second and retries again, when the second trial fails, it waits 2 seconds, when the third trial fails, it waits 4 seconds, and so on, until the defined number of retries exhausted. Note when
SrReporterenters the retry loop, messages sent via
SrAgentwill be queued up in the egress
SrQueue, until the
SrReportersuccessfully sends the aggregated requests so far or exhausts all retries.
Whether allow libcurl from installing any signal handlers, defaults to 1, which allows libcurl to install signal handlers. Certain versions of libcurl contains a bug that when built with a synchronous DNS resolver, randomly crashes when the DNS lookup timed out. When you experience this issue, you can workaround this bug by disabling libcurl from installing signal handlers. As a side effect, libcurl will not be able to terminate DNS lookup, recommended approach is to re-built libcurl with an asynchronous DNS resolver.
Whether to verify server's certificate when using HTTPS, defaults to 1. Many embedded devices have no CA certificates installed and thus not be able to verify server's certificate when communicating via HTTPS. As a workaround, you can disable certificate verification by setting this macro to 0.
Set scale of page size for file backed buffering, default is 3. When
filebuffeature is enabled for
SrReporter, messages are managed at a minimum unit of one page, instead of single message, for easy and efficient buffer managing. Therefore, larger page size will buffer more messages, but messages are also discarded in bigger chunks. In contrary, smaller page size buffers less messages, but messages are also discarded in smaller chunks. Possible page scale values and corresponding page size can be found in Table 1.
|Page Scale||Page Size|