apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.46k stars 3.96k forks source link

有支持io_uring的计划吗? #1650

Open cangfengzhs opened 2 years ago

cangfengzhs commented 2 years ago

bthread在读磁盘的时候会block整个线程,有没有计划引入io_uring然后采用异步IO的方式减少线程阻塞?

wwbmmm commented 2 years ago

bthread里面没有读磁盘的操作吧,你是指在bthread中运行的业务代码中进行了读磁盘的操作吗? 如果想减少阻塞,可以用异步的读,可以使用bthread_fd_wait来等待可读事件,等待过程中bthread会被挂起。

yanglimingcn commented 2 years ago

我理解用io_uring替换epoll API,是不是网络io和磁盘io都能同时支持呀?

flydt commented 2 years ago

我理解用io_uring替换epoll API,是不是网络io和磁盘io都能同时支持呀?

是的

deepzliu commented 2 years ago

看起来这个issue被淹没了,期待支持~ https://github.com/axboe/liburing

loongs-zhang commented 2 years ago

see https://new.qq.com/rain/a/20220606A08X5X00 and https://blog.csdn.net/bandaoyu/article/details/112904835 , these talk about the performance comparison between io_uring and RDMA.

When using a network card that supports RDMA, the performance of RDMA is much higher than that of io_uring; When using a network card that does not support RDMA and the Linux version is above 5.10, io_uring should be used; epoll should be used(if Linux supports) when using a network card that does not support RDMA and the Linux version is below 5.10;

I forgot the minimum version of io_uring supported by Linux.

@cangfengzhs @deepzliu

yanglimingcn commented 1 year ago

这个问题,如果现在brpc不能很快支持的话,也可以把io_uring的completion queue通过eventfd注册到epoll里面来使用吧

lishunan246 commented 9 months ago

期望支持

617076674 commented 2 months ago

期待支持。

yanglimingcn commented 2 months ago

io_uring比较复杂,模式比较多,支持的话,可能一下不能到位。