diff options
| author | Garrett D'Amore <garrett@damore.org> | 2023-12-16 19:13:40 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2023-12-16 21:11:15 -0800 |
| commit | ac40f5d7d0babb1b93ef398f88adec1c44c187eb (patch) | |
| tree | fdb2290a027762d4f4ac6e81920975ff55552990 /docs | |
| parent | cc5851749cfd87bdf446d7be4193c758a36d2232 (diff) | |
| download | nng-ac40f5d7d0babb1b93ef398f88adec1c44c187eb.tar.gz nng-ac40f5d7d0babb1b93ef398f88adec1c44c187eb.tar.bz2 nng-ac40f5d7d0babb1b93ef398f88adec1c44c187eb.zip | |
fixes #1663 Request/Reply Protocol Throughput and Scalability
This eliminates the req protocols use of nni_timer (and setting
a single timer node per request. This was problematic because it
devolves into O(n^2) as we wind up inserting timer nodes and having
to scan the list for the timer node.
The solution is to use a single scan - stop worrying about insertion,
but instead use a coarse granularity timer (defaults to 1 second)
for retries. Then do the O(n) scan just once per interval.
A new option, NNG_OPT_REQ_RESENDTICK, can be used to change the tick
interval for cases (like unit tests) where more fine grained timing
is required.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/man/nng_req.7.adoc | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/docs/man/nng_req.7.adoc b/docs/man/nng_req.7.adoc index 28765083..1d958562 100644 --- a/docs/man/nng_req.7.adoc +++ b/docs/man/nng_req.7.adoc @@ -1,6 +1,6 @@ = nng_req(7) // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2023 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This document is supplied under the terms of the MIT License, a @@ -101,9 +101,26 @@ The following protocol-specific option is available. When a new request is started, a timer of this duration is also started. If no reply is received before this timer expires, then the request will be resent. - (Requests are also automatically resent if the peer to whom - the original request was sent disconnects, or if a peer becomes available - while the requester is waiting for an available peer.) ++ +(Requests are also automatically resent if the peer to whom +the original request was sent disconnects, or if a peer becomes available +while the requester is waiting for an available peer.) ++ +Resending may be deferred up to the value of the `NNG_OPT_RESENDTICK` parameter. + +((`NNG_OPT_REQ_RESENDTICK`)):: + + (xref:nng_duration.5.adoc[`nng_duration`]) + This is the granularity of the clock that is used to check for resending. + The default is a second. Setting this to a higher rate will allow for + more timely resending to occur, but may incur significant additional + overhead when the socket has many outstanding requests (contexts). ++ +When there are no requests outstanding that have a resend set, then +the clock does not tick at all. ++ +This option is shared for all contexts on a socket, and is only available for the socket itself. + === Protocol Headers |
