Best way for grpc server with heavy disk operation

Hi.

I wrote service that serving to group of microservices and that is 90% disk operation ( store and fetch ) something like log operation

I use tonic ( grpc ) between services.

i think 4 way is posibble

  1. using Tokio::fs for io operation, that nonblocking but in my workload, i tested , it 6× times slower than std:fs

  2. using std::fs with tokio and dont worry about blocking

  3. using native thread for io operation with std::fs and communicate over channel,

  4. using tokio-uring that is complete asyncronous

which one is better ??

What is your definition of "better"? Are you trying to optimise for throughout, most ergonomic solution, least lines of code, etc.?

Normally, once you can articulate what exactly you care about, it's easy to see how each solution ranks against that metric and determine the best solution for your use case.

Otherwise, if we are leaving "better" undefined my answer is "butterflies"...

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.