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

get_info off the main thread #527

Closed
heifner opened this issue Aug 13, 2024 · 4 comments · Fixed by #920
Closed

get_info off the main thread #527

heifner opened this issue Aug 13, 2024 · 4 comments · Fixed by #920
Assignees
Labels
enhancement New feature or request 👍 lgtm

Comments

@heifner
Copy link
Member

heifner commented Aug 13, 2024

Currently /v1/chain/get_info processing is posted to the main thread. get_info could be moved off the main thread by copying the current get_info data into the get_info_results struct on every accept_block signal. Then get_info could be handled completely off the main thread.

See AntelopeIO/leap#1212 for original issue which includes EOS Nation API usage graphs.

@linh2931
Copy link
Member

linh2931 commented Oct 8, 2024

get_info is pushed to the read-only queue. In an API node with --read-only-thread configured, get_info will be serviced by read-only threads.

Do we want to have a dedicated thread for get_info?

If we cache get_info_results on every accept_block signal, will it be a waste if no get_info is called?

@heifner
Copy link
Member Author

heifner commented Oct 8, 2024

I don't think we want a dedicated thread for get_info, just the http thread pool.
If get_info is not called then yes it is a waste to update the info on every accept_block. However, this seems like a good trade-off. We can disable this logic if chain_api_plugin is not enabled.

@linh2931
Copy link
Member

linh2931 commented Oct 8, 2024

Thanks.

Why do the existing read-only threads not help here?

@greg7mdp
Copy link
Contributor

greg7mdp commented Oct 8, 2024

it is a waste to update the info on every accept_block

I doubt that the cost of doing this is even measurable. I wouldn't worry about it.

@linh2931 linh2931 moved this from Todo to In Progress in Team Backlog Oct 9, 2024
@linh2931 linh2931 moved this from In Progress to Awaiting Review in Team Backlog Oct 10, 2024
@github-project-automation github-project-automation bot moved this from Awaiting Review to Done in Team Backlog Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 👍 lgtm
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants