Enhance IO Threaded: use main thread to handle read/write work#6110
Enhance IO Threaded: use main thread to handle read/write work#6110antirez merged 2 commits intoredis:unstablefrom
Conversation
|
Hi @antirez , please have a look about this PR, since we are near Redis 6 RC1 and I think threaded-io is an important feature. |
|
I agree this should be in RC1, it's low hanging fruit that further improves performance and is much more efficient. |
|
Hello @soloestoy, @madolson, this is a great idea. And not just because we add a new thread to our pool, this moreover avoids that the main thread waits so much time in a busy loop, that can be a problem even from the POV of the kernel scheduler. I didn't check but I imagine that, after this change, we no longer have the problem that we had before, that is: when the configured number of threads exceeded the number of cores, it was likely for the threaded implementation to be slower. Merging it right now. Thanks! |
Enhance IO Threaded: use main thread to handle read/write work
Hi @antirez , the Threaded IO feature has a good performance, but now it works in busy loop mode, that looks a bit wasteful, especially the main thread.
After main thread distributes IO jobs to IO threads, it can only wait until all jobs done, do nothing but loop, here I think we can use the main thread's loop time to handle the IO jobs, just take the main thread as an IO thread at this time.
I test this mode, in the write side can optimize 25% or more depends on the io-threads, but the read side doesn't optimize much, you know.