zhengJade commented on PR #2819: URL: https://github.com/apache/brpc/pull/2819#issuecomment-2490551846
> 能否在bthread这个层面上,创建协程的时候设置一个属性,使它具有更高的优先级呢?现在这里专门设置了epoll_XXX,感觉有点特化。 另外,总是让epoll的bthread优先调度的话,会不会造成堆积很多任务的情况呢? 我觉得可以增加一个属性来表示高优先级,但是要说明一点,就是 epoll 的 任务被 steal 的前提肯定是有 worker 需要 steal from task_control,所以可证明 worker 自己的 queue 应该没有任务,证明他是空闲的,这个时候应该优先让其响应网络事件,这有两个好处 1. 保证网络任务能够及时响应。 2. 可以让所有的 worker 的 run_q 相对均匀,因为 q 中大量任务来源不是 steal,而是 deal event。 另一个问题,就是是否会造成堆积: 如果我们不响应 epoll 就会造成堆积,证明此刻的网络请求数量是大于 brpc 的处理能力的,否则我们不需要通过增加 steal 的次数这种比起 pop queue 更费时间的操作来加快某时刻处理存量 bthread 的能力。这是牺牲了 RT 带来的,感觉不合理。而且 QPS 高时候更容易造成 RT 抖动。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org