-
Notifications
You must be signed in to change notification settings - Fork 9
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
GCE perf #7
Comments
Some simple queryperfing to get baseline: 0.2: Queries per second: 58800.788936 qps |
Doing SO_REUSEADDR did not make any impact at all! |
Profile out when profiing: All this is done against the n1-standard-4 instance
|
This looks pretty OK-ish.
|
Uploading the profile |
Looking at the web view |
|
Well, |
There are 2 things:
|
Ok
The syscall is sending the message. Makes sense looks legit, i.e. answer 1) from above |
|
No using any of the functions in
It is nice to see |
OK, completely removing OOB UDP sending does not impact performace, hovers around 70K qps. Going to kernel for sending these udp packets is slow (and we do it for every packet). Now starting to wonder how other UDP servers deal with this. |
@johnbelamaric do you know how this is optimized in C programs? |
This also explains the speedup that I saw locally (although not the 3x increase), but AFAICT linux optimizes out the network when going through localhost - which means no kernel context switch..??? |
https://groups.google.com/forum/#!topic/golang-nuts/tBxagDKvrm8 mentions go DNS (sigh) and slowness of syscall on Linux |
Might make sense to write super simple udp echo server from scratch in go and see how that performs. |
As for optimization in C, no, but let me ping some folks here and see if they do. |
Thanks. The core question seems to be how long should it take to write 200 B to the UDP socket and is this slower than it should be in Go (or as it stands now: Go DNS) |
This is a supersimple Go UDP server: https://gist.github.com/miekg/d9bc045c89578f3cc66a214488e68227 Doing the same queryperf in GCE yields:
~85K qps, 20% faster than Go DNS. Nice but not earth shattering. |
LOL with profiling this drops to "Queries per second: 72013.668522 qps" |
|
|
UDP echo server in C (does not set the QR bit, just echo's bytes back): https://gist.github.com/miekg/a61d55a8ec6560ad6c4a2747b21e6128 Queryperf: 84343.155846 qps (some order of magnitude) |
https://github.com/kavu/go_reuseport makes this somewhat faster in the Go case. Fluctuates in my localhost testing from 60K to 90K |
From my colleague Kevin who is a veritable performance guru:
|
not cpu bound. Following some of Go code paths, they seem sane-ish, but all kind of stuff is happening because of the goroutine scheduling and so forth. Thanks for the update |
Does the simple echo server use go routines? It would be interesting to see the raw performance of a single-threaded server with no go routines. |
That should be simple to do; yes it is using multiple Go routines to write the answer. The reading is done from the main thread. SO_REUSEPORT could be helpful there, but initial/small scale testing didn't see any improvements there |
Geh, completely sequential, i.e. |
This is totally on-par with the C program now. On my (linode VPS) both progs go up to ~90Kqps with the queryperf as committed to this repo. |
userspace <-> kernel space context switches are hard, let's go fishing? |
I'm going to put NSD on these nodes tomorrow and check what it does. 'Cause I believe that we should reverse the testing; clearly this 80-100Kqps is the max this "hardware" can do. Let's optimize for that, i.e. cut out the syscall.Syscall of all perfs and see what's left. Depends a bit on my NSD testing, if that yields 2x qps something is very wrong somewhere. |
NSD is even more nonsensical and drops replies, so I get only 140 qps. Setup: nsd 4 (apt-get install)
nsd running with Think #7 (comment) is the most sensible way forward if we want to optimize performance. |
So basic idea is this: get a udp baseline: with udpserv.go and/or the C program that does the same. |
Hello @miekg Did you ever find time to finish this up? Edit: never mind, I missed the other open issues, seems like you moved on to using different setups, thanks for all the details! |
[ Quoting <[email protected]> in "Re: [coredns/perf-tests] GCE perf (..." ]
Hello @miekg
Did you ever find time to finish this up?
nope :(
|
I've started playing around in GCE.
3 machines:
All installed with Ubuntu-1703. CoreDNS is 007 (release from github).
The text was updated successfully, but these errors were encountered: