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

bad performance with ryzen 7950x (Arch Linux, Go 1.19) #1395

Open
abenz1267 opened this issue Oct 16, 2022 · 6 comments
Open

bad performance with ryzen 7950x (Arch Linux, Go 1.19) #1395

abenz1267 opened this issue Oct 16, 2022 · 6 comments

Comments

@abenz1267
Copy link

Hi,

i've recently noticed that performance with Fiber is way below what i'd usually expect. I tried using fasthttp directly and noticed it might be directly related to fasthttp and not fiber. Code can be found here: https://github.com/abenz1267/benchmark.

Fasthttp is performing worse than Gin here, although on my old 1700x it would perform way better. I noticed that the fasthttp version isn't even close to utilizing 100% CPU, it's more around 75%, hence the bad result.

The problem occurs when using a single instance of fasthttp, running multiple ones doesn't suffer the same problem.

Regards

@erikdubbelboer
Copy link
Collaborator

How are you sending the requests for your benchmark? Can you do some profiling to see what is going on? https://blog.golang.org/2011/06/profiling-go-programs.html

@abenz1267
Copy link
Author

Hi, sorry for missing that info: benchmarking was done on the same machine using wrk wrk -t32 -d10s -c1000 http://localhost:8080/

In the meanwhile i've found out that this might be related to the fact the 7950x has 2 CCDs. Disabling a whole CCD, so 8 cores, resulted in "expected" performance, as in: fasthttp beating vanilla Go. Vanilla Go itself was faster with only 8 cores vs. 16 cores as well. So i suspect goroutines and multiple CCDs don't go well together.

@erikdubbelboer
Copy link
Collaborator

That would be weird as fasthttp should use a lot less goroutines than net/http (1 per connection vs 3 per connection I think). Maybe it was something with GOMAXPROCS, or something in the Go scheduler.

@abenz1267
Copy link
Author

well, i can just report what i encounter. I haven't touched gomaxprocs... and too suspect something about the Go scheduler, but keep in mind: Go with Gin is FASTER than Fiber/Fasthttp. That's simply not normal.

Fiber took around 75% CPU usage, while everything else took 90%+. As if something is blocking. I don't know.

@gaby
Copy link
Contributor

gaby commented Mar 13, 2023

@abenz1267 Did ever find any more information regarding this? Have you tried updating both fasthttp/fiber to their latest versions and testing again

@abenz1267
Copy link
Author

@abenz1267 Did ever find any more information regarding this? Have you tried updating both fasthttp/fiber to their latest versions and testing again

Hi,

no, I haven't tested nor investigated ever since. I was hoping for a more general 'fix' regarding inter-ccx performance and Go. I haven't looked into why fasthttp in particular is so slow.

Regards

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

No branches or pull requests

3 participants