Opened 6 months ago
Closed 6 months ago
#35576 closed Cleanup/optimization (invalid)
Django too slow on first request
Reported by: | Sridhar | Owned by: | |
---|---|---|---|
Component: | Uncategorized | Version: | 2.2 |
Severity: | Normal | Keywords: | Django, Lambda |
Cc: | Sridhar | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
We have deployed our Django app on lambda, the first request always takes 5-6 seconds excluding lambda cold start times.
My Observations:
get_app_list
andreverse functions
take too long.- The reverse function to prepare and match uri takes O(n).
- Django adds two URLs for every model we register, so this wait time increases as we add models or write the Rest APIs.
I am attaching the Cprofile results below. Let me know if there are any ways to optimize this.
Attachments (1)
Change History (4)
by , 6 months ago
Attachment: | Screenshot from 2024-07-05 10-13-16.png added |
---|
comment:1 by , 6 months ago
Description: | modified (diff) |
---|
comment:2 by , 6 months ago
Description: | modified (diff) |
---|
comment:3 by , 6 months ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Thanks for this ticket, however, Django 2.2 is not supported and we've made a ton of improvements and optimizations since then. To submit a valid ticket you have to propose a concrete optimization targeted to the current
main
branch.As a side note, you should ask for help on [support channels https://forum.djangoproject.com/]. As for me, deploying a full Django project on lambdas doesn't sound like the best idea.