Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Monitoring and Introspecting Django

Monitoring and Introspecting Django

A 15 minute presentation given at PyCon 2014 as part of the Advanced Django Patterns workshop http://lanyrd.com/2014/pycon/scxqhp/ discussing techniques for monitoring and debugging large-scale Django applications in production.

Simon Willison

April 11, 2014
Tweet

More Decks by Simon Willison

Other Decks in Programming

Transcript

  1. StatsD! • Timers, counters, gauges • Local daemon, speaking UDP

    • Aggregates stats and sends to Graphite • Graphite! • Stores time-series data • Renders graphs on-demand
  2. StatsD! • Timers, counters, gauges • Local daemon, speaking UDP

    • Aggregates stats and sends to Graphite Graphite! • Stores time-series data • Renders graphs on-demand
  3. Application Service A Service B 9110dbba-6dd9-4d1c-8828-11be81ac0561 SERVICE_A do_action ... 9110dbba-6dd9...

    SERVICE_B do_action ... 9110dbba-6dd9... request GET /bar/ ... 9110dbba-6dd9...
  4. Application Service A Service B SERVICE_A do_action ... 9110dbba-6dd9... SERVICE_B

    do_action ... 9110dbba-6dd9... response GET /bar/ ... 9110dbba-6dd9...
  5. /* /2014/pycon/ */ SELECT "events_userevent"... /* manage.py send_subscriptions 1000 */

    SELECT... /* 9110dbba-6dd9-4d1c-8828-11be81ac0561 */ SELECT...
  6. • The most interesting bugs happen in production • Use

    statsd/graphite to understand what’s going on in your stack • Logs should be detailed, aggregated and searchable