-
-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread pool exhaustion due to MessageListener running on ThreadPool #824
Comments
@IgorMilavec, Could you please help me in understanding how you were able to conclude that ThreadPool was exhausted? |
I detected thread pool exhaustion the old fashioned way: my service stopped performing, but no errors were detected/reported. Upon investigation I determined that I saw that in For scenarios where you have a reasonable amount of short lived connections, the current solutions performs better. For scenarios where you have a lot of long lived connections, my workaround allows the system to run at all, but at the cost of system performance. By making the |
I see that you now use |
Session.Connect() (and Session.ConnectAsync() in #819) start MessageListener through ThreadAbstraction that runs the connection message pump on a ThreadPool thread. This causes thread pool exhaustion when the number of connected sessions reaches the maximum number of thread pool threads. Message loop should not be run through thread pool, as this consumes a (limited) shared resource. Also, running a thread for each session impacts system performance and limits scalability of the application.
Preferably we should avoid consuming an entire thread and make the message loop async.
The text was updated successfully, but these errors were encountered: