-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support server refresh concurrency #2537
Conversation
Sure, but by doing so, the latency measurements become unreliable. Not so much of an issue with a super snappy WiFi network, but this is an issue when the link is not that great. |
For DoH/ODoH/DoOH servers without an IP address, most of these would also use the fallback servers, which is something we want to minimize. With sequential refreshes, as soon as a server is ready, fallback servers can be ignored. |
I'm also a bit concerned about CPU/memory usage, as a lot of people are running Maybe that should be configurable. |
I agree that it can be configurable, because for most home PC, the bandwidth and cpu cost can be ignored, while achieving significant performance improvement. If use sequential refresh, it may take several minutes to find an optimal path, compared to only a few seconds for simultaneous refresh |
The model is: burst at a time, finish in several seconds. I would suggest setting the Maximum Concurrency. Besides the advantage and previous disadvantages, think about:
|
@keatonLiu |
Thank you for your ideas, I'm recently busy looking for an internship, I'll check it out and update soon. |
Add `cert_refresh_concurrency`
I think if the liveServers variable is not atomic there will be a race: 6d179bb |
Return |
Sure! |
Cover `offline_mode`.
LGTM. |
My previous negligence is fixed. |
how about combine all the ifs together, which looks better |
Good catch. But I'm not sure about the first 2. |
One more thing, the change from |
Do you mean that the list will be changed during output? I think RLock only allows concurrent reading, so I don't think the list will be changed during serving client requests. What's more, the sorted list is only about the initialRtt, which is only changed by calling the refresh function. |
Amend: Not saying the |
Oh, that's very detail, I haven't thought that. Do I need to change back? |
I'm not saying it's a bad thing. Let's see what @jedisct1 will say. |
This reverts commit 7045ad5.
`serversInfo.inner` may contain "dead" servers.
@keatonLiu |
Thank you! You can submit other improvements within new PRs. |
We can simultaneously refresh all servers instead of refresh them one by one, which can greatly improve startup speed without visible loss of accuracy