SlideShare a Scribd company logo
1 of 30
Download to read offline
Prodution Architecture and Deployment with Fabric - Andy McCurdy - @andymccurdy
Whiskey Media
Whiskey Sites
Your First Django App
Basic Config (web) ,[object Object]
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=5000 WSGIProcessGroup my-site WSGIScriptAlias / /home/code/my-site/deploy/wsgi/my-site.wsgi
Basic Config (media) ,[object Object]
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) ,[object Object]
PostgreSQL
Frank Wiles @ www.revsys.com
MySQL
Percona @ www.mysqlperformanceblog.com,[object Object]
It's incredibly easy...# settings.py MIDDLEWARE_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 minutes CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
Basic Deployment ,[object Object]
Run DB migrations / syncdb
Bounce wsgi daemons,[object Object]
As much RAM as possible
Write-heavy (>10%)? Get fast disks
Tune your config file,[object Object]
Use a resource monitoring tool like Munin to understand if your app is CPU or memory bound,[object Object]
Multiple load balancers for redundancy
Message queues
Crons
Search daemons (Solr, Sphinx)
etc...,[object Object]

More Related Content

What's hot

StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackIQ
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Alex S
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationJohn Lynch
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0bcoca
 
WordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiWordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiYuriko IKEDA
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to AnsibleCédric Delgehier
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the CloudWesley Beary
 
Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoBrian Hogan
 
Foreman - Advanced use cases - Timo Goebel
Foreman - Advanced use cases - Timo GoebelForeman - Advanced use cases - Timo Goebel
Foreman - Advanced use cases - Timo GoebelNETWAYS
 
Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2IMC Institute
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackIQ
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupSaewoong Lee
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to AnsibleDan Vaida
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackIQ
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer Hiroshi SHIBATA
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of AnsibleDevOps Ltd.
 

What's hot (20)

StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
 
Ansible - Crash course
Ansible - Crash courseAnsible - Crash course
Ansible - Crash course
 
Ansible best practices
Ansible best practicesAnsible best practices
Ansible best practices
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
WordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry PiWordPress Home Server with Raspberry Pi
WordPress Home Server with Raspberry Pi
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Hadoop on ec2
Hadoop on ec2Hadoop on ec2
Hadoop on ec2
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with Hugo
 
Foreman - Advanced use cases - Timo Goebel
Foreman - Advanced use cases - Timo GoebelForeman - Advanced use cases - Timo Goebel
Foreman - Advanced use cases - Timo Goebel
 
Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backup
 
Configuration Management in Ansible
Configuration Management in Ansible Configuration Management in Ansible
Configuration Management in Ansible
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 

Viewers also liked

MOSS 2007 / WSS 3.0 Certification Discussion
MOSS 2007 / WSS 3.0 Certification DiscussionMOSS 2007 / WSS 3.0 Certification Discussion
MOSS 2007 / WSS 3.0 Certification DiscussionShadeed Eleazer
 
5 Things Great Workers Do...And 1 Intention
5 Things Great Workers Do...And 1 Intention5 Things Great Workers Do...And 1 Intention
5 Things Great Workers Do...And 1 IntentionO.C. Tanner
 
Final 97 SEM 2009 NCMPR District 1 Presentation November 2
Final 97 SEM 2009 NCMPR District 1 Presentation   November 2Final 97 SEM 2009 NCMPR District 1 Presentation   November 2
Final 97 SEM 2009 NCMPR District 1 Presentation November 2Steve Bacher
 
MOSS Content Deployment 12.18.2008 Final
MOSS Content Deployment 12.18.2008 FinalMOSS Content Deployment 12.18.2008 Final
MOSS Content Deployment 12.18.2008 FinalShadeed Eleazer
 
Emma Burlow, QSA Partners, Go Green December Business Breakfast, St Mary Redc...
Emma Burlow, QSA Partners, Go Green December Business Breakfast, St Mary Redc...Emma Burlow, QSA Partners, Go Green December Business Breakfast, St Mary Redc...
Emma Burlow, QSA Partners, Go Green December Business Breakfast, St Mary Redc...Go Green
 
8 b las telecomunicaciones sara giraldo
8 b las telecomunicaciones sara giraldo8 b las telecomunicaciones sara giraldo
8 b las telecomunicaciones sara giraldoJhon William Florez
 
Accelerated Startup @ TechCode
Accelerated Startup @ TechCodeAccelerated Startup @ TechCode
Accelerated Startup @ TechCodeVitaly Golomb
 
Epivolve Manual
Epivolve ManualEpivolve Manual
Epivolve ManualSaba Ghole
 
Creating Culture of Change for Retail Sustainability (Passion For Retail 09)
Creating Culture of Change for Retail Sustainability (Passion For Retail 09)Creating Culture of Change for Retail Sustainability (Passion For Retail 09)
Creating Culture of Change for Retail Sustainability (Passion For Retail 09)DIG360 Consulting Ltd.
 
How much is your feed system costing you?
How much is your feed system costing you?How much is your feed system costing you?
How much is your feed system costing you?Lely North America
 
Wei-Ting Ko portfolio
Wei-Ting Ko portfolioWei-Ting Ko portfolio
Wei-Ting Ko portfolioWei-Ting Ko
 
Linked in ads made easy special free report - How to use Linkedin Adds -Lates...
Linked in ads made easy special free report - How to use Linkedin Adds -Lates...Linked in ads made easy special free report - How to use Linkedin Adds -Lates...
Linked in ads made easy special free report - How to use Linkedin Adds -Lates...Mikey Lovegood
 
Death by Bad Design
Death by Bad DesignDeath by Bad Design
Death by Bad DesignJoyce Lee
 
Buying an On-Demand Geofilter on Snapchat
Buying an On-Demand Geofilter on SnapchatBuying an On-Demand Geofilter on Snapchat
Buying an On-Demand Geofilter on SnapchatRoy Harmon
 
88th Annual Academy Awards: The Oscars
88th Annual Academy Awards: The Oscars88th Annual Academy Awards: The Oscars
88th Annual Academy Awards: The OscarsNova Media
 
Market Reserach Potential for Snapchat
Market Reserach Potential for SnapchatMarket Reserach Potential for Snapchat
Market Reserach Potential for SnapchatAlexandra Marin
 

Viewers also liked (20)

MOSS 2007 / WSS 3.0 Certification Discussion
MOSS 2007 / WSS 3.0 Certification DiscussionMOSS 2007 / WSS 3.0 Certification Discussion
MOSS 2007 / WSS 3.0 Certification Discussion
 
5 Things Great Workers Do...And 1 Intention
5 Things Great Workers Do...And 1 Intention5 Things Great Workers Do...And 1 Intention
5 Things Great Workers Do...And 1 Intention
 
Final 97 SEM 2009 NCMPR District 1 Presentation November 2
Final 97 SEM 2009 NCMPR District 1 Presentation   November 2Final 97 SEM 2009 NCMPR District 1 Presentation   November 2
Final 97 SEM 2009 NCMPR District 1 Presentation November 2
 
MOSS Content Deployment 12.18.2008 Final
MOSS Content Deployment 12.18.2008 FinalMOSS Content Deployment 12.18.2008 Final
MOSS Content Deployment 12.18.2008 Final
 
Emma Burlow, QSA Partners, Go Green December Business Breakfast, St Mary Redc...
Emma Burlow, QSA Partners, Go Green December Business Breakfast, St Mary Redc...Emma Burlow, QSA Partners, Go Green December Business Breakfast, St Mary Redc...
Emma Burlow, QSA Partners, Go Green December Business Breakfast, St Mary Redc...
 
8 b las telecomunicaciones sara giraldo
8 b las telecomunicaciones sara giraldo8 b las telecomunicaciones sara giraldo
8 b las telecomunicaciones sara giraldo
 
Never Be Late Again!
Never Be Late Again!Never Be Late Again!
Never Be Late Again!
 
Accelerated Startup @ TechCode
Accelerated Startup @ TechCodeAccelerated Startup @ TechCode
Accelerated Startup @ TechCode
 
Epivolve Manual
Epivolve ManualEpivolve Manual
Epivolve Manual
 
Creating Culture of Change for Retail Sustainability (Passion For Retail 09)
Creating Culture of Change for Retail Sustainability (Passion For Retail 09)Creating Culture of Change for Retail Sustainability (Passion For Retail 09)
Creating Culture of Change for Retail Sustainability (Passion For Retail 09)
 
How much is your feed system costing you?
How much is your feed system costing you?How much is your feed system costing you?
How much is your feed system costing you?
 
Wei-Ting Ko portfolio
Wei-Ting Ko portfolioWei-Ting Ko portfolio
Wei-Ting Ko portfolio
 
K453 (1)
K453 (1)K453 (1)
K453 (1)
 
Linked in ads made easy special free report - How to use Linkedin Adds -Lates...
Linked in ads made easy special free report - How to use Linkedin Adds -Lates...Linked in ads made easy special free report - How to use Linkedin Adds -Lates...
Linked in ads made easy special free report - How to use Linkedin Adds -Lates...
 
Death by Bad Design
Death by Bad DesignDeath by Bad Design
Death by Bad Design
 
Setembro jardim
Setembro jardimSetembro jardim
Setembro jardim
 
Туристическая карта Санкт-Петербурга
Туристическая карта Санкт-ПетербургаТуристическая карта Санкт-Петербурга
Туристическая карта Санкт-Петербурга
 
Buying an On-Demand Geofilter on Snapchat
Buying an On-Demand Geofilter on SnapchatBuying an On-Demand Geofilter on Snapchat
Buying an On-Demand Geofilter on Snapchat
 
88th Annual Academy Awards: The Oscars
88th Annual Academy Awards: The Oscars88th Annual Academy Awards: The Oscars
88th Annual Academy Awards: The Oscars
 
Market Reserach Potential for Snapchat
Market Reserach Potential for SnapchatMarket Reserach Potential for Snapchat
Market Reserach Potential for Snapchat
 

Similar to Deployment with Fabric

Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Deepak Garg
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Ortus Solutions, Corp
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby TeamArto Artnik
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9Corey Oordt
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment TacticsIan Barber
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureHabeeb Rahman
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with CapistranoRamazan K
 
Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoAlmir Mendes
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetAchieve Internet
 

Similar to Deployment with Fabric (20)

Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Capistrano Overview
Capistrano OverviewCapistrano Overview
Capistrano Overview
 
Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9Pythonic Deployment with Fabric 0.9
Pythonic Deployment with Fabric 0.9
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
Fabric: A Capistrano Alternative
Fabric:  A Capistrano AlternativeFabric:  A Capistrano Alternative
Fabric: A Capistrano Alternative
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with Capistrano
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Capistrano
CapistranoCapistrano
Capistrano
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 

Recently uploaded

MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Recently uploaded (20)

MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

Deployment with Fabric

  • 1. Prodution Architecture and Deployment with Fabric - Andy McCurdy - @andymccurdy
  • 5.
  • 9. processes if you're unsure of thread safetyWSGIDaemonProcess my-site python-path=/home/code/ processes=2 threads=150 maximum-requests=5000 WSGIProcessGroup my-site WSGIScriptAlias / /home/code/my-site/deploy/wsgi/my-site.wsgi
  • 10.
  • 11. Use Nginx to proxy traffic to Apache
  • 12. 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; } }
  • 13.
  • 15. Frank Wiles @ www.revsys.com
  • 16. MySQL
  • 17.
  • 18. It's incredibly easy...# settings.py MIDDLEWARE_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 minutes CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
  • 19.
  • 20. Run DB migrations / syncdb
  • 21.
  • 22. As much RAM as possible
  • 24.
  • 25.
  • 26. Multiple load balancers for redundancy
  • 28. Crons
  • 30.
  • 31.
  • 35. Add a new web server to the cluster
  • 36.
  • 37. Deployment Options Fabric + Very simple, tasks are just Python functions + Easy to chain together tasks to create complex scripts out of bite size pieces - No source control integration - No out of box support - Some bugs, although fairly easy to work around, and new maintainer is working on fixes
  • 38.
  • 41. be mindful of tasks that may fail
  • 42. each remote command starts fresh
  • 43.
  • 44. run() - Run a command remotely
  • 45. sudo() - Run a command remotely as another user
  • 46. put() - Copy a file from local to remote
  • 47. get() - Copy a file from remote to local
  • 48.
  • 50. Control access to root user via sudoers
  • 51.
  • 56. Global settings or all Fabric deployments
  • 57.
  • 58. Tasks # fabfile.py def uptime(): run('uptime') $> fab uptime -H 10.1.1.3 [10.1.1.3] run: uptime [10.1.1.3] out: 05:20:39 up 88 days, 12:00, 0 users, load average: 0.03, 0.03, 0.00
  • 59. Mapping Roles to Tasks # fabfile.py @roles('web') def uptime(): run('uptime') $> fab uptime [10.1.1.1] run: uptime [10.1.1.1] out: 05:20:39 up 88 days... [10.1.1.2] run: uptime [10.1.1.2] out: 05:20:39 up 88 days...
  • 60.
  • 61. Can't override decorated tasks at command line as docs suggestdef default_roles(*role_list): def selectively_attach(func): if not env.roles and not env.hosts: return roles(*role_list)(func) else: if env.hosts: func = hosts(*env.hosts)(func) if env.roles: func = roles(*env.roles)(func) return func return selectively_attach
  • 62. All better now #fabfile.py @default_roles('web', 'db') def uptime(): run('uptime') $> fab uptime # runs on all hosts in the 'web' and 'db' roles $> fab uptime --roles lb # runs only on hosts in the 'lb' role
  • 63.
  • 64. Use a context manager when failures are anticipated# fabfile.py from __future__ import with_statement # py2.5 def symlink_me(): with settings(warn_only=True): run('rm /path/to/symlink') run('ln -s /home/andy /path/to/symlink')
  • 65.
  • 66. Great for sys-admin and one-off tasks# fabfile.py @default_roles('all') def invoke(command): "Invoke an arbritrary command" sudo(command) # install new packages on all hosts in one command $> fab invoke:"apt-get install git-core"
  • 67. Real World Tasks $> fab --list Available commands: bounce_wsgi_procs Bounce the WSGI procs by touching the files deploy Full deployment deploy_media Push media to S3 invoke Invoke an arbritrary command migrate Run any migrations via South reload_nginx Update Nginx's running config splash_off Configure Nginx to serve the site splash_on Configure Nginx to serve a downed-site page update_repositories Push code to servers update_dependencies Update dependencies to third party libs
  • 68. Whiskey's Deployment def deploy(splash='no'): "Full deployment" deploy_media() update_cached_repositories() update_dependencies() generate_releases() if splash == 'yes': splash_on() _symlink_code() migrate() bounce_wsgi_procs() if splash == 'yes': splash_off() $> fab deploy:splash=yes