bloomberg / memray

Memray is a memory profiler for Python
https://bloomberg.github.io/memray/
Apache License 2.0
13.17k stars 392 forks source link

How to profile gunicorn workers? #579

Closed TheCodeYoda closed 5 months ago

TheCodeYoda commented 5 months ago

my startup command looks like this

gunicorn --workers 2 -k uvicorn.workers.UvicornWorker my_server.main:server --bind '0.0.0.0:8000' --access-logfile - --error-logfile - --log-level info

How do I profile this using memray? is there a way to use the cli with this startup command?

dilshans2k commented 3 months ago

Hey can you share the cli command used?

I am running uvicorn server, but i don't think it will be any different compared to guvicorn. uvicorn score:app --reload --log-config ../log.ini