StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.92k stars 1.51k forks source link

SDK design - threads alocation #2812

Open dtila opened 1 month ago

dtila commented 1 month ago

While I was investigating some timeouts, I have noticed there are a lot of threads created by Redis to function as completion threads.

I went and read all the documentation and I assume this was the original design with code was added on top of it over time due to an original implementation.

Since I have found it strange to have threads duplicated with the same name and almost 60 on an ultrabook computer, I have made a video where I am raising this concern due to a lot of impacted servers: https://www.youtube.com/watch?v=6f7t_Ylyqzw&t=705

From the code review I made, I can see this is not an easy task and I assume developers are aware since a separate thread pool has been added in version 2.x just as a hack to go over the .net thread pool limit

Also looked at the backlog and I think this will fix most of the timeout issues that are raised at the moment. This will also remove a lot of documentation about timeouts and debugging information - since I think that was the reason for the implementation

I am raising this PR just to see if there is a roadmap this and if there is a plan to fix or not

mgravell commented 1 month ago

It is very likely that this will be overhauled when I complete the IO rework piece, yes.

dtila commented 1 month ago

Pinpoint the branch, so others can contribute as well.