title: How to profile Django on Gunicorn in production
body: <p>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. </p>
  
  <p>I'm running:</p>
  
  <ul>
  <li>Python 2.7.3</li>
  <li>Gunicorn 18.0</li>
  <li>Django 1.6</li>
  </ul>
  
  <p>This is my Gunicorn config:</p>
  
  <pre><code>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',
      ),
  }
  </code></pre>
  
  <p>Whats the best way to do memory profiling when running Django with Gunicorn?</p>