Prodution Architecture and Deploymentwith Fabric- Andy McCurdy -@andymccurdy
Whiskey Media
Whiskey Sites
Your First Django App
Basic Config (web)Apache
mod_wsgi
use daemon mode
threads more efficient
processes if you're unsure of thread safetyWSGIDaemonProcess my-site python-path=/home/code/                  processes=2 threads=150 maximum-requests=5000WSGIProcessGroup my-siteWSGIScriptAlias / /home/code/my-site/deploy/wsgi/my-site.wsgi
Basic Config (media)Nginx
Use Nginx to proxy traffic to Apache
Meanwhile Nginx serves mediaupstream my-site {    server 127.0.0.1:8000;}server {    listen 80;    location ~ ^/media/ {        root /home/code/my-site;        expires 30d;    }    location / {        proxy_pass http://my-site;        proxy_set_header X-Real-IP $remote_addr;    }}
Basic Config (db)Databases
PostgreSQL
Frank Wiles @ www.revsys.com
MySQL
Percona @ www.mysqlperformanceblog.comBasic Config (cache)Use Memcached!  Even 16mb will significantly help against a Digg or being Slashdot'ed
It's incredibly easy...# settings.pyMIDDLEWARE_CLASSES = (    'django.middleware.cache.UpdateCacheMiddleware',    'django.middleware.common.CommonMiddleware',    'django.middleware.cache.FetchFromCacheMiddleware')CACHE_BACKEND = 'memcached://127.0.0.1:11211/'CACHE_MIDDLEWARE_SECONDS = 60*5                   # 5 minutesCACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
Basic DeploymentCopy Code & Media (rsync or scp)
Run DB migrations / syncdb
Bounce wsgi daemonsManaging Growth (db)Move DB to its own server
As much RAM as possible
Write-heavy (>10%)? Get fast disks
Tune your config fileManaging Growth (web)Add more web servers
Use a resource monitoring tool like Munin to understand if your app is CPU or memory boundEven More GrowthReplicated or sharded Databases
Multiple load balancers for redundancy
Message queues
Crons
Search daemons (Solr, Sphinx)
etc...(not so) Basic Deploymentimage credit:Brad Fitzpatrick

Deployment with Fabric