I had a memory issue with Django's bulk_update queryset method.
The TLDR version is that bulk_update prepares all the update statements in advance (even when batch_size is set) which can use more memory than expected.
Details and a solution in the blog:
I've improved the performance of the starter packs list query from about 200ms to 2ms. 🎉
The trick was to stop dynamically computing the number of accounts in a starter pack and instead precompute it in a column.
A bit more work on each update, but worth it!
Yesterday, Python 3.14 was released, and today all of my Django side projects are running on 3.14. 🎉
The upgrade didn't require any code changes on my part, but I did see a few return statements in the finally block SyntaxWarnings in a few dependencies.
Over the weekend, I migrated one of my Django Apps from Gunicorn to Granian.
TLDR:
• The migration went smoothly.
• There were no visible performance gains.
• I still can't set a timeout for requests.
I also wrote a blog post about this: