SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
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]

Contenu connexe

Tendances

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.
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
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
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
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
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
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
 
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
 

Dernier (20)

Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
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
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
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
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
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
 
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
 

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