Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #1663 Request/Reply Protocol Throughput and Scalability #1726

Merged
merged 1 commit into from
Dec 17, 2023

Conversation

gdamore
Copy link
Contributor

@gdamore gdamore commented Dec 17, 2023

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.

(For now the tick interval for this is fixed at one second, but I intend to follow up with a change to make an option.)

@gdamore gdamore force-pushed the gdamore/req-scaling-timer branch 3 times, most recently from 74bc9ea to a0829fa Compare December 17, 2023 04:51
src/compat/nanomsg/nn.c Fixed Show fixed Hide fixed
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.
@gdamore gdamore force-pushed the gdamore/req-scaling-timer branch from a0829fa to ac40f5d Compare December 17, 2023 05:11
@gdamore gdamore merged commit ac40f5d into master Dec 17, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant