SlideShare a Scribd company logo
1 of 57
Scaling and Distributing
Dima Nedbaylo
Dima Malenko
So, you want to tell
us about distributed
systems?
OpenOffice.org on iPad
Systems are distributed for a reason
Our reasons were following:
• low latency for end-user connections
• horizontal scalability
• availability
Systems are distributed for a reason
Our reasons were following:

• low latency for end-user
connections
• horizontal scalability
• availability
Historia de número uno
Práctico
We have to be close to the user
Every 5ms of ping between the user and the server counts
Computing power provider with
multiple locations and great
managements capabilities?
Computing power provider with
multiple locations and great
managements capabilities?
[Only] 8 locations

[Just] $0.6/hour
c3.2xlarge
14 ECU
15 GB RAM

2*80 GB SSD
$0.6 * 720 = $432/mo
So, you’ve got new server…
• Minimal setup of Ubuntu 12.04
• Magic fabric script to turn minimal Ubuntu
into rollApp app server
• Works great and allows to get server up and
running within couple of hours
Now you’ve got 10 servers…
• And need to update one of your
components
• Or run a maintenance procedure
• Or install a couple of new packages
• Or correct config
Ansible
http://www.ansibleworks.com
• Learned in just 1 hour
• In 2 hours we had a script to setup new app
server
• Way better and more reliable than fabric for
the same purpose
• Way easier than chef
Ansible vs. Fabric
• Requires hosts inventory database
• If you need something very custom – have
to code in Python
00

00
00
00
00
00

00
Ansibe Ad-hoc
Ansible has a lot of modules for ad-hoc mode:
• downloading/uploading files
• managing packages, users, services
• Launching EC2 instances and other AWS
stuff
• databases and db users operations
Inventory Exmple
[appservers_eu]
appsrv-007.rollapp.com
ansible_ssh_user=guess_who
ansible_ssh_private_key_file=...

[appservers:children]
appservers_eu
[appservers:vars]
root_password='password'
Playbooks
• Plain yaml file
• Contains server configuration
• Per se it is just set of tasks that invoke
ansible modules
Simple Playbook
--- include: playbooks/timezone.yml
- include: playbooks/ntp.yml
- hosts: appservers
sudo: yes
vars:
prefix_dir: /opt
tasks:
# user: dnedbaylo
- name: create dnedbaylo user
user: name=dnedbaylo groups=admin shell=/bin/zsh
- name: authorized keys for dnedbaylo
authorized_key: user=dnedbaylo
key=”ssh-rsa ….”
Ansible vs. Fabric: playbook mode
• Plain language (YAML) for playbooks
• A lot of modules ready to use (like creating
EC2 instances, users management, apt
repositories management, etc.)
• No need to worry about details (does user
already exist?)
• Playbooks are “idempotent”
Ansible vs. Chef
Ansible vs. Chef
• No need to learn chef
• No need to learn ruby
• No weird ruby requirements (not so easy to
install chef on Linux Mint)
• No need to use additional tools to make life
with chef solo easier (hello knife-solo)
Historia de número dos
Instructivo
The difficulty with
distributed systems is that
they are … distributed
My First Law of Distributed
Objects Design:
Do not distribute your objects
http://martinfowler.com/bliki/FirstLaw.html
At all times
protect integrity of the
system…
at all cost
Put on your oxygen mask first before helping
others
App Server 1

App Server 2

Web
App Server 3

App Server N
Web keeps track of
consequent errors
for each app server

App Server 1

App Server 2

Web
App Server 3

App Server N
Web keeps track of
consequent errors
for each app server

App Server 1

App Server 2

Web
App Server 3
App Server monitors
its internal state and
deactivates itself if
bad things happen

App Server N
App Server 1

App Server 2

Web
App Server 3

App Server N
App Server 1

App Server 2

Web
App Server 3

App Server N
App Server 1

App Server 2

Web
App Server 3

App Server N
App Server 1

App Server 2

Web
App Server 3

App Server N
What Happened?
App Server 1

App Server 2

Web
App Server 3

App Server N
OOM killer engaged
• pings work
• simple status checks
work(!)

App Server 1

App Server 2

Web
App Server 3

App Server N
Requests still come
in, but never get
actually processed

App Server 1

App Server 2

Web
App Server 3

App Server N
DB connections pool
got saturated. Old
requests hung, new
requests fail

App Server 1

App Server 2

Web
App Server 3

App Server N
Irregular errors and
failures because of
resource starvation

App Server 1

App Server 2

Web
App Server 3

App Server N
Верить нельзя никому, порой
даже себе… Мне – можно!
Lessons Learned
• Timeouts on all connections to other
components
• Monitoring beyond just vitality signs
• Keep track of “in progress” requests to
prevent cascading errors
Things to Remember
• [Almost] all modern applications are
distributed
• Never trust any external interface
• Be ready to sacrifice part to keep the entire
system afloat
• Monitor each interface from both sides on
different layers (not just pinging)
Never Trusting Is Not Easy
• No (!) out of the box solutions for controlling
response timeouts
– requests only has connection timeouts
– if you are on gevent or the like – you are good to go
with greenlet timeouts

• [Almost] always opt for aggressive health
control parameters
– request processing time
– max address space
– max number of queued requests
Historia de número tres
Inesperado
Get application startup
time optimization
Here ought to be a screenshot
but it is not here
Here ought to be a screenshot
but it is not here
Always (I mean ALWAYS) make screenshots
when you come across something interesting
Application Startup
User
Browser

preparing to launch

connect to application

App
Server

Web

launch application
52
Close to one another

Application Startup
User
Browser

Web

Faster
App
Server

Slower
53
Application Startup
User
Browser

Web
App
Server
54
Do not take anything for granted
Any questions?
Now:

and later:
dnedbaylo@rollapp.com

@dmalenko
dmalenko@rollapp.com
www.dmalenko.org

More Related Content

What's hot

From vagrant to production - Mark Eijsermans
From vagrant to production - Mark EijsermansFrom vagrant to production - Mark Eijsermans
From vagrant to production - Mark Eijsermans
Devopsdays
 
Async CTP 3 Presentation for MUGH 2012
Async CTP 3 Presentation for MUGH 2012Async CTP 3 Presentation for MUGH 2012
Async CTP 3 Presentation for MUGH 2012
Sri Kanth
 

What's hot (20)

Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
 
Scaling
ScalingScaling
Scaling
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
 
Ansible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel AvivAnsible on aws - Pop-up Loft Tel Aviv
Ansible on aws - Pop-up Loft Tel Aviv
 
Making development environments not suck | #econfpsu #econfpsu16
Making development environments not suck | #econfpsu #econfpsu16Making development environments not suck | #econfpsu #econfpsu16
Making development environments not suck | #econfpsu #econfpsu16
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
Stabilizing SE Build - Selenium conf 2013
Stabilizing SE Build - Selenium conf 2013 Stabilizing SE Build - Selenium conf 2013
Stabilizing SE Build - Selenium conf 2013
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
 
Manage your environment with DSC
Manage your environment with DSCManage your environment with DSC
Manage your environment with DSC
 
Network Automation (NetDevOps) with Ansible
Network Automation (NetDevOps) with AnsibleNetwork Automation (NetDevOps) with Ansible
Network Automation (NetDevOps) with Ansible
 
[Start] Playing
[Start] Playing[Start] Playing
[Start] Playing
 
From vagrant to production - Mark Eijsermans
From vagrant to production - Mark EijsermansFrom vagrant to production - Mark Eijsermans
From vagrant to production - Mark Eijsermans
 
Managing Large Selenium Grid
Managing Large Selenium Grid�Managing Large Selenium Grid�
Managing Large Selenium Grid
 
Serverless Application Model - Executing Lambdas Locally
Serverless Application Model - Executing Lambdas LocallyServerless Application Model - Executing Lambdas Locally
Serverless Application Model - Executing Lambdas Locally
 
Monitor-Driven Development Using Ansible
Monitor-Driven Development Using AnsibleMonitor-Driven Development Using Ansible
Monitor-Driven Development Using Ansible
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
 
Database and Public Endpoints redundancy on Azure (CloudBrew)
Database and Public Endpoints redundancy on Azure (CloudBrew)Database and Public Endpoints redundancy on Azure (CloudBrew)
Database and Public Endpoints redundancy on Azure (CloudBrew)
 
Async CTP 3 Presentation for MUGH 2012
Async CTP 3 Presentation for MUGH 2012Async CTP 3 Presentation for MUGH 2012
Async CTP 3 Presentation for MUGH 2012
 
Ansible Devops North East - slides
Ansible Devops North East - slides Ansible Devops North East - slides
Ansible Devops North East - slides
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
 

Viewers also liked (9)

Hang Over Easy Services Marketing 760
Hang Over Easy Services Marketing 760Hang Over Easy Services Marketing 760
Hang Over Easy Services Marketing 760
 
Welcome to our page
Welcome to our pageWelcome to our page
Welcome to our page
 
Does iTunes Provide Everything You Need To Be Entertained. Anywhere. Anytime?
Does iTunes Provide Everything You Need To Be Entertained. Anywhere. Anytime?Does iTunes Provide Everything You Need To Be Entertained. Anywhere. Anytime?
Does iTunes Provide Everything You Need To Be Entertained. Anywhere. Anytime?
 
Just Do It
Just Do ItJust Do It
Just Do It
 
Marketing without Money
Marketing without MoneyMarketing without Money
Marketing without Money
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
 
Intro to tsql unit 13
Intro to tsql   unit 13Intro to tsql   unit 13
Intro to tsql unit 13
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
 
Intro to tsql unit 15
Intro to tsql   unit 15Intro to tsql   unit 15
Intro to tsql unit 15
 

Similar to Scaling and Distributing

The challenges of live events scalability
The challenges of live events scalabilityThe challenges of live events scalability
The challenges of live events scalability
Guy Tomer
 
Lotuscript for large systems
Lotuscript for large systemsLotuscript for large systems
Lotuscript for large systems
Bill Buchan
 

Similar to Scaling and Distributing (20)

Common Challenges in DevOps Change Management
Common Challenges in DevOps Change ManagementCommon Challenges in DevOps Change Management
Common Challenges in DevOps Change Management
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
 
Monitoring of OpenNebula installations
Monitoring of OpenNebula installationsMonitoring of OpenNebula installations
Monitoring of OpenNebula installations
 
UNIT-I Introduction to Ansible.pptx
UNIT-I Introduction to Ansible.pptxUNIT-I Introduction to Ansible.pptx
UNIT-I Introduction to Ansible.pptx
 
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
 
To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…To Build My Own Cloud with Blackjack…
To Build My Own Cloud with Blackjack…
 
The challenges of live events scalability
The challenges of live events scalabilityThe challenges of live events scalability
The challenges of live events scalability
 
RavenDB embedded at massive scales
RavenDB embedded at massive scalesRavenDB embedded at massive scales
RavenDB embedded at massive scales
 
Ansible.pdf
Ansible.pdfAnsible.pdf
Ansible.pdf
 
Sergey Dzyuban "To Build My Own Cloud with Blackjack…"
Sergey Dzyuban "To Build My Own Cloud with Blackjack…"Sergey Dzyuban "To Build My Own Cloud with Blackjack…"
Sergey Dzyuban "To Build My Own Cloud with Blackjack…"
 
Five Years of EC2 Distilled
Five Years of EC2 DistilledFive Years of EC2 Distilled
Five Years of EC2 Distilled
 
Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"Anton Boyko "The future of serverless computing"
Anton Boyko "The future of serverless computing"
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
Lotuscript for large systems
Lotuscript for large systemsLotuscript for large systems
Lotuscript for large systems
 
Experiences with Debugging Data Races
Experiences with Debugging Data RacesExperiences with Debugging Data Races
Experiences with Debugging Data Races
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
Building Real World Applications using Windows Azure - Scott Guthrie, 2nd Dec...
Building Real World Applications using Windows Azure - Scott Guthrie, 2nd Dec...Building Real World Applications using Windows Azure - Scott Guthrie, 2nd Dec...
Building Real World Applications using Windows Azure - Scott Guthrie, 2nd Dec...
 
Building azure applications ireland
Building azure applications irelandBuilding azure applications ireland
Building azure applications ireland
 
Kubernetes at NU.nl (Kubernetes meetup 2019-09-05)
Kubernetes at NU.nl   (Kubernetes meetup 2019-09-05)Kubernetes at NU.nl   (Kubernetes meetup 2019-09-05)
Kubernetes at NU.nl (Kubernetes meetup 2019-09-05)
 

More from Dima Malenko

Cultural test by... a door at a mall
Cultural test by... a door at a mallCultural test by... a door at a mall
Cultural test by... a door at a mall
Dima Malenko
 

More from Dima Malenko (13)

Where are the new technologies coming from?
Where are the new technologies coming from?Where are the new technologies coming from?
Where are the new technologies coming from?
 
Nation: technological and/or successful
Nation: technological and/or successfulNation: technological and/or successful
Nation: technological and/or successful
 
3x3+3 #6 New and old platforms
3x3+3 #6 New and old platforms3x3+3 #6 New and old platforms
3x3+3 #6 New and old platforms
 
Future of the Apps: what startups need to know
Future of the Apps: what startups need to knowFuture of the Apps: what startups need to know
Future of the Apps: what startups need to know
 
Crises in startups
Crises in startupsCrises in startups
Crises in startups
 
Magic Triangle: Product, Market, Users
Magic Triangle: Product, Market, UsersMagic Triangle: Product, Market, Users
Magic Triangle: Product, Market, Users
 
What We Learned From Porting 50+ Cloud Apps to Tizen
What We Learned From Porting 50+ Cloud Apps to TizenWhat We Learned From Porting 50+ Cloud Apps to Tizen
What We Learned From Porting 50+ Cloud Apps to Tizen
 
Evolution of software projects
Evolution of software projectsEvolution of software projects
Evolution of software projects
 
Browsers
BrowsersBrowsers
Browsers
 
Tornado - different Web programming
Tornado - different Web programmingTornado - different Web programming
Tornado - different Web programming
 
Как команду соберете, так она и поплывет
Как команду соберете, так она и поплыветКак команду соберете, так она и поплывет
Как команду соберете, так она и поплывет
 
Part Time Agile
Part Time AgilePart Time Agile
Part Time Agile
 
Cultural test by... a door at a mall
Cultural test by... a door at a mallCultural test by... a door at a mall
Cultural test by... a door at a mall
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Scaling and Distributing