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

tap-agent taking too long to start up #355

Closed
gusinacio opened this issue Oct 8, 2024 · 6 comments · Fixed by #431
Closed

tap-agent taking too long to start up #355

gusinacio opened this issue Oct 8, 2024 · 6 comments · Fixed by #431
Assignees
Labels
low p2 Medium priority size:medium Medium type:perf Issues related to performance

Comments

@gusinacio
Copy link
Contributor

gusinacio commented Oct 8, 2024

Problem statement

Indexers with high performance create tons of receipts and have multiple allocations. We need to speed up start-up by parallelizing the SenderAllocation creation and also look at indexes in our database that may be affecting the initialization.

This can be done by spawning tasks for the initialization for SenderAccounts and SenderAllocations.

The code is currently sync:

This is just a suggestion. If you find any other performance improvement opportunity, feel free to add to the PR as well.

There are indexers that have around 600 allocations open. It would be good to have a benchmark for this.

Also we need to create some indexes for ravs

@gusinacio gusinacio added size:medium Medium p1 High priority type:perf Issues related to performance labels Oct 8, 2024
@gusinacio gusinacio added the p2 Medium priority label Oct 14, 2024 — with Linear
@gusinacio gusinacio removed the p1 High priority label Oct 14, 2024
@YashBit
Copy link
Contributor

YashBit commented Oct 15, 2024

@gusinacio Please assign this to me.

@gusinacio gusinacio added the external label Oct 15, 2024 — with Linear
@gusinacio gusinacio changed the title [Perf] tap-agent taking too long to start up tap-agent taking too long to start up Oct 17, 2024
@gusinacio gusinacio added the low label Oct 18, 2024 — with Linear
@YashBit
Copy link
Contributor

YashBit commented Oct 21, 2024

@gusinacio I have a few questions:

  1. Which library would you recommend for parallelisation?

There are indexers that have around 600 allocations open. It would be good to have a benchmark for this.

Could you please elaborate on this?

This can be done by spawning tasks for the initialization for SenderAccounts and SenderAllocations.

Parallel tasks?

Also we need to create some indexes for ravs

Please can you elaborate on this?

Sorry, I am new to indexer-rs

@gusinacio
Copy link
Contributor Author

@gusinacio I have a few questions:

  1. Which library would you recommend for parallelization?

I think just using tokio::spawn is enough to speed up. Right now one can only be created after the previous one was created. Maybe you could spawn all the tasks and loop over and join them using JoinSet.

There are indexers that have around 600 allocations open. It would be good to have a benchmark for this.

Could you please elaborate on this?

Maybe this is a different PR related to #8. Don't worry about this for now.

This can be done by spawning tasks for the initialization for SenderAccounts and SenderAllocations.

Parallel tasks?

Yeah, using tokio::spawn and joining all of them before proceeding.

Also we need to create some indexes for ravs

Please can you elaborate on this?

Actually, you don't need to worry about this, we need to create indexes inside the database but this is in graphprotocol/indexer and not here.

@gusinacio
Copy link
Contributor Author

Hey, are you still planning to do this?

@YashBit
Copy link
Contributor

YashBit commented Oct 24, 2024

@gusinacio Yes. I have a FT job, I mostly start issues on the weekends.

Is that okay?

Copy link
Contributor Author

Hey, I have to take this one because it became a higher priority.

@gusinacio gusinacio linked a pull request Oct 30, 2024 that will close this issue
@gusinacio gusinacio assigned gusinacio and unassigned YashBit Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low p2 Medium priority size:medium Medium type:perf Issues related to performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants