tonic icon indicating copy to clipboard operation
tonic copied to clipboard

add Single-threaded runtime(double performance improve)

Open zhuxiujia opened this issue 4 years ago • 2 comments

In my tests, use tokio-current_thread_runtime(), tonic Grpc Performance and QPS can be improved by at double performance。(test by ghz benchmark)

can you add an option feature to support current_thread_runtime( just like actix-web/ actix-rt ,Number of threads: number of CPU cores x 2) ? This change can greatly improve QPS scores

641633933803_ pic_hd

zhuxiujia avatar Oct 11 '21 06:10 zhuxiujia

Tonic should already support the tokio single threaded runtime, is there something you see missing?

LucioFranco avatar Oct 13 '21 21:10 LucioFranco

@zhuxiujia Hi, just curious how did you run the grpc server? What kind of computer did you run the test on?

I have tested the grpc server by running the example helloworld grpc server on my laptop (macbookpro 2019). However, ghz test result shows that the server can handle only up to about 4000 requests/sec. I am not sure why I could not see the good performance shown here and other blogs.

Thanks

chengzh2008 avatar Mar 21 '22 21:03 chengzh2008

@chengzh2008 Same, did you find an answer?

mahdibaghdadi avatar Dec 15 '22 10:12 mahdibaghdadi

Its likely an issue with ghz and not tonic.

LucioFranco avatar Dec 15 '22 14:12 LucioFranco

Tonic should already support the tokio single threaded runtime, is there something you see missing?

How can this be activated?

gitmalong avatar Oct 05 '23 20:10 gitmalong