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

DB queries >2K per view #471

Open
2 tasks
Tracked by #465
jon-nfc opened this issue Jan 14, 2025 · 2 comments
Open
2 tasks
Tracked by #465

DB queries >2K per view #471

jon-nfc opened this issue Jan 14, 2025 · 2 comments
Assignees
Milestone

Comments

@jon-nfc
Copy link
Member

jon-nfc commented Jan 14, 2025

As each view is run, authorization is conducted.

Details

Authorization is required, however when concurrent requests come in, the request time increases to beyond expectaations (>2s).

Screenshot from 2025-01-15 00-21-04

currently there are in excess of >2k database queries per view.

Tasks

  • Refactor DB queries to use prefetch_related as appropriate.

  • test amount of DB queries per view
    investigate if this can be tested

@jon-nfc jon-nfc added this to the Next Release milestone Jan 14, 2025
@jon-nfc jon-nfc moved this to Planning in Centurion ERP Jan 14, 2025
@jon-nfc jon-nfc self-assigned this Jan 16, 2025
@jon-nfc jon-nfc moved this from Planning to In progress in Centurion ERP Jan 16, 2025
jon-nfc added a commit that referenced this issue Jan 16, 2025
jon-nfc added a commit that referenced this issue Jan 16, 2025
@jon-nfc
Copy link
Member Author

jon-nfc commented Jan 16, 2025

Post changes:

Image

  • left graph: pre changes
  • Right graph: post changes

Test ran was 1vu, 100x requests per url for each URL in alphabetical order.

jon-nfc added a commit that referenced this issue Jan 16, 2025
jon-nfc added a commit that referenced this issue Jan 16, 2025
@jon-nfc
Copy link
Member Author

jon-nfc commented Jan 16, 2025

Results

Deployed to staging to tet production config

Image

ALL requests < 600ms

Image

DB operations dropped significantly. <800

more improvements can and will be done in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

No branches or pull requests

1 participant