employees, 8 engineers • Tra c increasing 15-20% a month • Flat organizational structure, every engineer is a product manager • Fast turnaround, new feature launches every week (sometimes daily) Sunday, March 13, 2011
websites • 30 million profiles • 170 million comments • 500 million visitors • 17,000 requests/ second peak • 450,000 websites • 15 million profiles • 75 million comments • 250 million visitors Sunday, March 13, 2011
no “commodity hardware” • Cheaper to upgrade • Everything is redundant • Partition data where you need to, scale partitions vertically • Upgrade hardware (more RAM, more drives, more cores) • Python apps tend to be CPU bound Sunday, March 13, 2011
vs nginx + uWSGI • Bottleneck is in the application Python Web Servers mod_wsgi uWSGI 0 200 400 600 req/sec Min Avg Max 0 15.0 30.0 45.0 60.0 mod_wsgi uWSGI Memory Sunday, March 13, 2011
and even sometimes monkey patch to make it scale to our needs • Fortunately, we don’t have to do too much (Yay, Django!) • Unfortunately, we can’t use the whole of the Django internal components (and if we do, we do it in atypical ways) Sunday, March 13, 2011
locally • Rely on CI for dependency coverage • Heavy use of open source packages • No NIH syndrome • Deploy frequently, 3-7 times a day • Lots of branches, but master is “stable” • Realtime reporting on exceptions, metrics • Our test suite is the main blocker (slow) Sunday, March 13, 2011
versions of features before public release Deploy features to portions of a user base at a time to ensure smooth, measurable releases Sunday, March 13, 2011
over • Finally, deploy to a subset of servers • Open Sentry (our exception logger) • Monitor Graphite • Deploy to 35 servers (~8 minutes) • Full rollback in < 30 seconds Sunday, March 13, 2011
• “Stuck” with Hudson (or Jenkins) • Most tightly integrated plugins are geared towards Java developers • Which framework do we use? • unittest(2), nose, doctests, LETTUCE? • We use unittest and nose • Need to report code coverage, speed of tests, pylint (or pyflakes) Sunday, March 13, 2011
• Clean syntax, clear standards • All languages need PEP8.py and PyFlakes • Interpreted, fast... enough • Very easy to learn • We all started by learning Django first, then Python Sunday, March 13, 2011
frameworks • We need less clones, and more combined e ort • Improving existing Python solutions • More Python solutions for existing products Sunday, March 13, 2011
(feature switches) https://github.com/disqus/gargoyle • Django DB Utils (collection of db helpers for Django) https://github.com/disqus/django-db-utils • Jenkins CI http://jenkins-ci.org/ code.disqus.com Sunday, March 13, 2011