Architecture & Infrastructure

iDoneThis consists of a web application (django) and a collection of background tasks (celery). We also maintain and host idt_slack, the iDoneThis<->Slack integration, which is technically a third-party service (independent codebase, infrastructure). idt_slack is also hosted entirely on heroku and its architecture and infrastructure is a simplified version of that of iDoneThis.

iDoneThis is entirely hosted on Heroku. For Heroku credentials please ask [email protected]. Developers make sure you've gone through the

Getting Started Guide

.

Technical / hosting architecture overview for idonethis: http://cl.ly/image/3m2h2T221o0q see also: https://github.com/idonethis/idonethis/blob/heroku/docs/README.md#technical-architecture-summary.

Technical / hosting architecture overview for idt_slack: http://cl.ly/122j0h2p333W

Heroku Apps:

Lists of resources available to each application ie servers (dynos) and services (add-ons e.g. datbase, memcached,...) are listed at those links.

iDoneThis

Dyno configuration is specified in the Procfile (standard heroku convention): https://github.com/idonethis/idonethis/blob/heroku/Procfile This file defines the types of dynos (web is required) and the command to execute for each.

Web Server Configuration

Web dynos on heroku with standard configuration need to run a python web server (it is possible to run behind nginx or apache, but only with a custom buildpack). The python web server then interfaces with the idonethis application (django) over WSGI, which is handled by django.

The choices for python web servers are gunicorn (most popular), waitress (what we use), and a few others. We've had performance problems that seemed consistent with this: http://blog.etianen.com/blog/2014/01/19/gunicorn-heroku-django/ in the past which were mitigated by switching to the current configuration in waitress.

Waitress is presently configured to run 90 threads per dyno. This is configured in the Procfile. The limiting factor on the number of web dynos and threads to run is database connections. While iDoneThis does use database connection pooling, a good heuristic is that number_of_web_dynos x threads < number_of_available_connections - 100

Database Configuration