I have a memory leak that is hard to reproduce in testing environment. So I'd like to profile my production server for a limited time period to get an overview about which objects take up most memory. It seems that it's not that easy to profile Gunicorn due to the usage of greenlets.
I'm running:
This is my Gunicorn config:
CONFIG = {
'environment': {
'DJANGO_SETTINGS_MODULE': 'myapp.settings',
},
'user': 'myapp',
'group': 'myapp',
'args': (
'--bind=127.0.0.1:8088',
'--workers=8',
'--worker-class=socketio.sgunicorn.GeventSocketIOWorker',
'--timeout=300',
'--error-logfile=/var/log/gunicorn/myapp-error.log',
'--max-requests=100',
'--log-level=debug',
'myapp.wsgi:application',
),
}
Whats the best way to do memory profiling when running Django with Gunicorn?
I use the New Relic service:
http://newrelic.com/
They have free plan, with 24h data retantion.
Is very easy to setup:
http://newrelic.com/python#installation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With