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

Performance issues when using api/resources/filter_by_checksums #551

Open
JonoYang opened this issue Dec 2, 2024 · 1 comment
Open

Performance issues when using api/resources/filter_by_checksums #551

JonoYang opened this issue Dec 2, 2024 · 1 comment
Assignees

Comments

@JonoYang
Copy link
Member

JonoYang commented Dec 2, 2024

On certain large purldb instances, when using the api/resources/filter_by_checksums endpoint via the scancode.io map_deploy_to_develop pipeline, the match_to_purldb_resource step is very slow and can take +30 hours to complete.

After debugging, we found that the two biggest reasons for the slowness are:

  • Ordering of Resources, a lot of CPU time is spent ordering resources from a query
  • Decoding large JSON fields, a lot of time is spent parsing JSON fields if they are too big, like the history field on Package

Immediate solutions that come to mind:

  • Remove ordering for Resources
  • Create proper History model for Package, expedient thing would be to empty history json field. Look into using .only() on queries.
@JonoYang JonoYang self-assigned this Dec 2, 2024
JonoYang added a commit that referenced this issue Dec 3, 2024
JonoYang added a commit that referenced this issue Dec 3, 2024
@JonoYang
Copy link
Member Author

JonoYang commented Dec 3, 2024

Restoring ordering by id and creating indices on id for Resource and Package did not help the slow API performance.

JonoYang added a commit that referenced this issue Dec 5, 2024
JonoYang added a commit that referenced this issue Dec 5, 2024
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