panjf2000 / gnet

🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go.
https://gnet.host
Apache License 2.0
9.69k stars 1.04k forks source link

[Question]: What is the maximum number of cores tested by anyone? I just tested 192 cores and it's better than evio etc but... #558

Closed ouvaa closed 7 months ago

ouvaa commented 8 months ago

Actions I've taken before I'm here

Questions with details

anyone tested on 448 cores before? any experience with that against other rust based equivalents?

update: i just tested a rust version of monoio on 192cores aws c6a 384gb ram and gnet is faster gnet 5393926 req/s monoio 4958282 req/s

Code snippets (optional)

No response

ouvaa commented 8 months ago

actually i came across this issue too... https://github.com/golang/go/issues/65064

panjf2000 commented 7 months ago

I'm a little bit confused, you said that gnet worked great on the 192-cores machine before, but now it doesn't anymore?

ouvaa commented 7 months ago

@panjf2000 i saw the stats wrong, it wasnt fully utilizing the cores and it has the issues here: https://github.com/golang/go/issues/65064

it worked better than the rest including evio etc.

panjf2000 commented 7 months ago

Just out of curiosity, what networking frameworks did you test exactly?

ouvaa commented 7 months ago

@panjf2000 gnet https://github.com/IceFireDB/redhub evio https://github.com/tidwall/redcon

as mentioned, i'm looking at io_uring and maybe even af_xdp now because epoll cant take advantage of multi cores like 192 cores. https://www.51cto.com/article/627651.html

it's really terrible the performance. and with more cores, the cpu will take up a 3-5% tested on aws c6a. 192 cores 384gb ram

now i'm hoping for tls and io_uring from gnet. pls look at the tls as top priority.

ouvaa commented 7 months ago

@panjf2000 my bad, i was testing redis and http at the same time.

http version is "perfect". (need tls and io_uring)

it's fastest than all others, able to take advantage of multiple cores even up to 192 cores effectively.

i updated my code. it was my customized profiler that was underperforming

ouvaa commented 7 months ago

@panjf2000 my bad again, i tested one last time and found gnet is best used in 8 core - 12 core environments. "optimum" at 8 cores, anymore than that will have diminish return.

yes it is able to use up all 192 cores but the speed actually dropped greater than lower cores, around 16 cores i think (where it is peaked)

e.g. 8 cores at 530000 req/s 16 cores at 580000 req/s 192 cores at 530000 req/s

1 core at 65000 req/s

p.s. : i wasnt looking at the max core per cpu then. i just tested 192 threads then realised it's as fast as running on 8 cores even with the 192 cores used 100%