'How to use memray with Gunicorn and Django?
Solution 1:[1]
During local development, I've had success by running:
python -m memray run manage.py runserver 0:8000 --nothreading
I haven't had memray running in production yet, but memray's documentation does mention --follow-fork
may be useful when using Gunicorn.
Memray can optionally continue tracking in a child process after a parent process forks. This can be useful when using multiprocessing, or a framework utilizing a pre-fork pattern like Celery or Gunicorn.
https://bloomberg.github.io/memray/run.html#tracking-across-forks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Aaron |