-
Notifications
You must be signed in to change notification settings - Fork 2.4k
multisocket plugin #6882
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
multisocket plugin #6882
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we want to implement this. Multi-process makes a number of things much worse. For example monitoring metrics and similar things.
I think we should put more effort into making multi-threaded scaling better rather than paper over the issue with multiple processes.
|
This is more or less doable currently by running multiple instances of coredns. |
Isn't that what this does? It allows multiple internal servers (same process) to run on the same address and port. Basically, in #5595 it was determined that the single socket used to read the queries was a bottleneck; this alleviates that, IIUC. |
|
Let me tell you about our scenario. This fix allows to scale CoreDNS vertically.
In general, I agree. But it is more difficult to control these instances. If we run several processes in a container, it is not clear how to detect main process. If the instance goes down, who will restart it? We would like to have one process so that Kubernetes itself controls the lifecycle of our container. |
|
Sorry, I clearly didn't read the code / proposal well enough. Setting up multiple listeners from the same process is the goal. I think this is fine for now, at least until Go has better support for this. |
|
Perhaps we can consider an alternate plugin name? “reuseport” is a bit confusing given that coredns already binds using the reuseport option. Perhaps “multiprocess” or “multiserver” or something. |
"numsockets" would most clearly describe what it does, I think. It's not about multiple processes. |
|
Hi! Please take into account, that we also need additional changes in Caddy server - coredns/caddy#6 to address this issue - #5595 (comment) with performance degradation after server reload. |
|
Maybe this should be a command line flag and not something reloadable? |
During reloading, the server restarts. When restarting, all servers start listening to a single socket because here: https://github.com/coredns/caddy/blob/master/caddy.go#L221, we have a map of server addresses to PacketConn. With numsockets, we are starting multiple servers on the same address. Therefore, reloading is a a problem for us. If we want this functionality with numsockets, we need to fix this somehow. It doesn't matter whether it is a plugin or a CLI flag. |
|
Can anyone please take a look at this PR - coredns/caddy#6? |
|
@Shmillerov if you happen to be at KubeCon NA in Salt Lake City next month, would be great if you want to talk about this in the CoreDNS maintainer track session. Otherwise I will cover it. Great stuff. |
|
@johnbelamaric, thank you, but I can't participate :) I believe you will cover me! |
Signed-off-by: Viktor Rodionov <[email protected]>
- update doc Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
- default as GOMAXPROCS - update README Signed-off-by: Viktor Rodionov <[email protected]>
Signed-off-by: Viktor Rodionov <[email protected]>
|
@Shmillerov just FYI since I don't think you are on the CoreDNS Slack. We are hoping to do the following in the next few days:
|
johnbelamaric
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not merge until we cut a patch release with low-risk changes first.
Missed from coredns#6882 Signed-off-by: Ville Vesilehto <[email protected]>
Missed from #6882 Signed-off-by: Ville Vesilehto <[email protected]>
1. Why is this pull request needed and what does it do?
Added the ability to run multiple servers on the same port using the multisocket plugin. This increases the throughput of CoreDNS in environments with a large number of CPU cores.
Syntax:
default value of NUM_SOCKETS is equal to GOMAXPROCS.
Performance testing:
#6882 (comment)
2. Which issues (if any) are related?
#5595
3. Which documentation changes (if any) need to be made?
I added a readme for the plugin. After merging to CoreDNS repo, need to re-generate https://coredns.io/plugins/ using https://github.com/coredns/coredns.io
4. Does this introduce a backward incompatible change or deprecation?
Changes are backward compatible