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

Number of goroutines were increasing gradually #1197

Closed
Yashk767 opened this issue Mar 20, 2024 · 0 comments
Closed

Number of goroutines were increasing gradually #1197

Yashk767 opened this issue Mar 20, 2024 · 0 comments
Assignees

Comments

@Yashk767
Copy link
Contributor

Yashk767 commented Mar 20, 2024

Problem

With every iteration in infinite voting for loop, we see a gradual increase in number of goroutines for few epochs and the count does go down after certain epochs but goes on gradual increase which can cause over usage if CPU if the node is running for a long time.

Check whether every goroutine created should be ensured that its getting closed after its execution.

Check for go routines in a for loop are handled correctly.

Check whether every channel is closed using a defer keyword.

Causes

  1. Currently node creates separate http client instance for every API and makes request using client.Do() which creates a new goroutine on every call
  • Using a common http client for all the requests will help here as the new request can use the existing connections from the connection pool and there will be no need create a new connection everytime in a separate go routine.
  1. keystore.Accounts() opens a new goroutine everytime whenever we try to fetch keystore files present in keystore directory. - Fetching private key every time increases goroutine count #1195
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

1 participant