Skip to content
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

Cluster.Run on the thread pool #124

Open
verdie-g opened this issue May 28, 2024 · 1 comment
Open

Cluster.Run on the thread pool #124

verdie-g opened this issue May 28, 2024 · 1 comment

Comments

@verdie-g
Copy link
Contributor

verdie-g commented May 28, 2024

tendThread = new Thread(new ThreadStart(this.Run));

Currently, Cluster.Run is executed on a dedicated threads. This is not great for several reasons:

  1. it's a inefficient use of resource, especially when the application is connected to many clusters
  2. it involves extra context switches
  3. when investigating thread pool starvation, a trace could show that Cluster.Run was the method that spent the most time blocking threads. After some time, you realize that it's a in dedicated thread so it can be ignored for the investigation.
    image

What do you think about making the Aerospike client a good citizen by turning this code async and running it in the thread pool?

@shannonklaus
Copy link
Collaborator

I am in the process of changing the client to be async awaitable. I will keep your concerns in mind when I revisit the tendThread and Cluster.Run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants