title: Difference Between Gunicorn Worker Processes and Heroku Worker Dynos
body: <p>I'm hoping the community can clarify something for me, and that others can benefit.  </p>
  
  <p>My understanding is that gunicorn worker processes are essentially virtual replicas of Heroku web dynos.  In other words, <em>Gunicorn's worker processes should not be confused with Heroku's worker processes</em> (e.g. Django Celery Tasks).</p>
  
  <p>This is because Gunicorn worker processes are focused on handling web requests (basically throttling up the performance of the Heroku Web Dyno) while Heroku Worker Dynos specialize in Remote API calls, etc that are long-running background tasks.</p>
  
  <p>I have a simple Django app that makes decent use of Remote APIs and I want to optimize the resource balance.  I am also querying a PostgreSQL database on most requests. </p>
  
  <p>I know that this is very much an oversimplification, but am I thinking about things correctly?</p>
  
  <p><strong>Some relevant info:</strong></p>
  
  <p><a href="https://devcenter.heroku.com/articles/process-model" rel="nofollow noreferrer">https://devcenter.heroku.com/articles/process-model</a></p>
  
  <p><a href="https://devcenter.heroku.com/articles/background-jobs-queueing" rel="nofollow noreferrer">https://devcenter.heroku.com/articles/background-jobs-queueing</a></p>
  
  <p><a href="https://devcenter.heroku.com/articles/django#running-a-worker" rel="nofollow noreferrer">https://devcenter.heroku.com/articles/django#running-a-worker</a></p>
  
  <p><a href="http://gunicorn.org/configure.html#workers" rel="nofollow noreferrer">http://gunicorn.org/configure.html#workers</a></p>
  
  <p><a href="http://v3.mike.tig.as/blog/2012/02/13/deploying-django-on-heroku/" rel="nofollow noreferrer">http://v3.mike.tig.as/blog/2012/02/13/deploying-django-on-heroku/</a></p>
  
  <p><a href="https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/gunicorn/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/gunicorn/</a></p>
  
  <p><strong>Other Quasi-Related Helpful SO Questions for those researching this topic:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/10401513/troubleshooting-site-slowness-on-a-nginx-gunicorn-django-stack">Troubleshooting Site Slowness on a Nginx + Gunicorn + Django Stack</a></p>
  
  <p><a href="https://stackoverflow.com/questions/11713871/performance-degradation-for-django-with-gunicorn-deployed-into-heroku">Performance degradation for Django with Gunicorn deployed into Heroku</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10527512/configuring-gunicorn-for-django-on-heroku">Configuring gunicorn for Django on Heroku</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10401513/troubleshooting-site-slowness-on-a-nginx-gunicorn-django-stack">Troubleshooting Site Slowness on a Nginx + Gunicorn + Django Stack</a></p>