This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
core: remove io-per-queue's io mode & fastrun's running mode #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
删除了难懂的、可能有bug、我们也基本用不上的fastrun和io-per-queue。因为想要fastrun得允许一个进程下开多个socket端口。删除之后,rdsn的初始化流程可以得到比较大的简化。
fastrun下的moodycamel_queue保留了下来,性能优化的时候可能用得着。
移除io-per-queue后,之前timer-service改成了io-per-node, 也就是全局一个timer线程。根据运行情况来看基本没有影响,timer线程比较闲,观察都是Sleep状态,cpu利用率大概20%左右。也可以从这个角度来推想:我们的aio thread也是全局只有一个的,也没有成为系统的瓶颈。这个带来的好处是,系统的总线程数减少了非常多。
经过测试发现:全局共用一个timer线程,写性能会大概有3%~5%的下滑。稍微调整了一下代码,将io-per-queue的方式内置到了每个threadpool内部,这样就和线上的运行方式一致了。
把timer-servce内置到threadpool里面后,rdsn的thread local就没必要export出timer service的接口了,service node也没有必要保留timer service的接口了,所以从这些地方里把他们移除掉了。