pycon2012

20
Lessons Learnt. An In Production, Scaleable Django Stack PyCon ireland - Dublin, Oct 13th-14th 2012 [email protected] / [email protected] / @redsnapper88

Upload: john-moylan

Post on 05-Jul-2015

305 views

Category:

Documents


2 download

DESCRIPTION

My PyCon Ireland 2012 talk with an analysis and description of some of the various in production parts of our stack. IE, Linux, MySQL, Memcache, Django, Apache, Solr, Django-sentry, Buildout/Fabric, statsd etc. Some discussion also of alternative choices, up and coming technology, things to watch.

TRANSCRIPT

Page 1: Pycon2012

Lessons Learnt.An In Production,

Scaleable Django StackPyCon ireland - Dublin, Oct 13th-14th 2012

[email protected] / [email protected] / @redsnapper88

Page 2: Pycon2012

Brief Intro to RTE.ie

Website of Ireland's national broadcaster

Page 3: Pycon2012

Problem

Mostly W.O.R.M, but some stuff can't be cached :(Lot's of content(100's GB's of HTML)10's TB of Audio and Video

Lots of strands (News, Sport, Business, Ent., TV, Radio, Teletext, Archives, Young Peoples, Performing Groups...)

Small team.Try to keep things as simple and efficient as possible.

...massive growth

Page 4: Pycon2012

Traffic Growth

Oct 2010 V's Oct 2011Traffic nearly doubled.

Page 5: Pycon2012

Flashmob Traffic

36Gb/s of Traffic. 41K Concurrent streams.Playlists were not cacheable........

But what a great fight.

Page 6: Pycon2012

Static?

Legacy system published to static files using XML/XSL Publisher.

Multiple versions per type of view.

SSI's inside SSI's inside SSI's

Republishing a strand could take days.

Page 7: Pycon2012

Dynamic Requirement

Evaluated some systems:

Wicket, Rails, Shale....Django

Hmmm... nice

All in package, sensible defaults. Similar problem domain.

Page 8: Pycon2012

Try Before you buy

2008 Wrote prototype video upload sharing site... (Django 0.96) and then decided to make it live.

http://web.archive.org/web/20090318064215/http://www.rte.ie/tv/theden/ugc/red/video/

Page 9: Pycon2012

Try Before You Buy

2009 Original RTÉ Player - Written in Django.

2011Let's use Django to make the whole site dynamic!

Page 10: Pycon2012

..continued

2012Sport, About, RTÉ Player v.2, Radio, News?, Archives, playlists, lifestyle, SSO......and on and on

2013..More

Page 11: Pycon2012

Django Delivery

LinuxApache with Event MPM and mod_wsgiMysql and MHA (tip Innodb plugin)Solr for search and 'NoSQL'Varnish (used to use Squid)LVS-NAT and LVS-DR Load-balancers.MemcacheDeploying Glusterfs

Page 12: Pycon2012

Code Management

GitRedmineGitosis

Page 13: Pycon2012

Deployment

CobblerFabricBuildout

Page 14: Pycon2012

Monitoring

Monitor & Measure everything!ZenossRRDToolMRTGGraphiteStatsd - mozilla's Django-statsdSentryLot's of custom monitoring

Page 15: Pycon2012

In House Monitoring projects

Pyvarnishhttps://github.com/redsnapper8t8/pyvarnish

Page 16: Pycon2012

In House Monitoring Projects

Digital Dash - (open sourced soon)

Page 17: Pycon2012

Benchmarking

Tool agnostic but seem to use these alot.

Bonnie++Netperf

#HTTPHttperfSiege

Page 18: Pycon2012

Performance Tips

1. Memory, memory, memory2. Caching - in memory3. Does it scale horizontally?4. KISS

Page 19: Pycon2012

Lessons Learnt.

Read from memory whenever possibleCache, learned this one a long time ago but whenever we have issues it can usually be tracked down bad design and lack of caching. Don't hit your web servers unless you have to.

Memcache, Varnish

Long live Rest - GET's should not have side effects. Varnish

KISS - and no resume driven development.