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

Improved concurrency performance #332

Closed
ntduan opened this issue Mar 31, 2022 · 3 comments · Fixed by #334
Closed

Improved concurrency performance #332

ntduan opened this issue Mar 31, 2022 · 3 comments · Fixed by #334

Comments

@ntduan
Copy link
Collaborator

ntduan commented Mar 31, 2022

polkadot-js/api#4707

@shunjizhan
Copy link
Collaborator

shunjizhan commented Mar 31, 2022

I think we can also do some caching for apiAt for the latest 10 blocks in RPC adaptor, since most queries ask for these blocks. The implementation should be pretty similar to how we cache tx hashes

@shunjizhan
Copy link
Collaborator

shunjizhan commented Mar 31, 2022

so basically if many request comes in, they can share the same instance of apiAt and won't need to make many new connections.

But still, this is just a workaround we can do, it will definitely be nice to improve concurrency performance from the api itself

@ntduan
Copy link
Collaborator Author

ntduan commented Mar 31, 2022

I think we can also do some caching for apiAt for the latest 10 blocks in RPC adaptor, since most queries ask for these blocks. The implementation should be pretty similar to how we cache tx hashes

Yes, the api has fixed some of the problems. But it still creates a new api object for each blockhash, which can cause a lot of memory consumption and service crash when processing many requests at the same time. I will create a block registry based cache.

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

Successfully merging a pull request may close this issue.

3 participants