SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Капістрано Та СістемД
Олександр Сімонов
CEO Amoniac OU
RubyConfLT 2017
Capistrano && SystemD
Oleksandr Simonov
CEO Amoniac OU
RubyConfLT 2017
cat /dev/about/me
Software Developer
System Administrator
Engineer
Founder
Team Leader
Speaker
Application Server
4 CPUs / 48Gb RAM
Application Server Inside
PostgreSQL 9.5
Ruby 2.3.3
2 x Rails 4.2 Applications
Puma Cluster 3x32
Sidekiq 3x25
Memory Usage After Boot
PostgreSQL - 500Mb
Puma Cluster - 120Mb
Sidekiq - 100Mb
Total: 500Mb DB + 440Mb Rails App
Memory Usage After One Week
PostgreSQL - 550Mb
Puma Cluster - 2Gb
Sidekiq - 1Gb
Total: 550Mb DB + 6GB Rails App
Memory Usage After One Month
PostgreSQL - 570Mb
Puma Cluster - 5Gb
Sidekiq - 2,5Gb
Total: 570Mb DB + 15GB Rails App
CPU Usage
4 CPUs
5 Nginx processes (master + 4 workers)
8 Puma processes (master + 3 workers )
2 Sidekiq processes
Max 192 PostgreSQL processes (fork on every connection)
Puma
PostgreSQL
Sidekiq
Nginx
IO Usage
PostgreSQL - multiple DB files, log files
Nginx - log files, requests cache, static files, file uploads
Rails - log files, cache files, file uploads, third party services
DiskPostgreSQL
Nginx
Rails
Rails
WHAT TO DO?!
JAIL
nice/ionice/renice
FreeBSD Jail
Solaris Zones
Linux Control Groups
Linux Control Groups
CPU Time
System memory
Disk bandwidth
Network bandwidth
Linux Control Groups
CPU Time - max 20% of time
System memory - 1GB max
Disk bandwidth - 5Mb/sec
Network bandwidth - 2Mb/sec
SystemD
system and service manager
event logger
user session manager
network interfaces manager
device manager
boot manager
systemd + cgroups
Process supervising
Resource management
Dependency management
Logs management
Make a reality
Make a reality
Read about SystemD
Make a reality
Read about SystemD
Read about CGroups
Make a reality
Read about SystemD
Read about CGroups
Create service file
Make a reality
Read about SystemD
Read about CGroups
Create service file
SSH to server and setup it
Make a reality
Read about SystemD
Read about CGroups
Create service file
SSH to server and setup it
SSH to all your servers and do the same
Make a reality
Read about SystemD
Read about CGroups
Create service file
SSH to server and setup it
SSH to all your servers and do the same
PROFIT!
WE NEED AUTOMATE IT!
capistrano-systemd-core
Github: amoniacou/capistrano-systemd-core
capistrano-systemd-core
Simple configuration
Only 1 line setup for each server
No need in SUDO
Support any command
CPU, Memory and IO limitations
Puma, Unicorn, Sidekiq and Resque special support in the future
Simple configuration
set :systemd_services, {
puma: {
cmd: 'puma -p 3000',
cpu_quota: 70,
memory_max: '1G'
},
sidekiq: {
cmd: 'sidekiq',
cpu_quota: 30,
memory_max: '512M'
}
}
Only 1 line setup on server
# loginctl enable-linger username
Supported Limitations
CPUQuota
MemoryMax
IOWeight
Slice
More in the future….
Questions
GitHub: @simonoff
Twitter: @ceo_simonov
FB: @ceosimonov
Website: https://amoniac.eu

Weitere ähnliche Inhalte

Was ist angesagt?

Oreilly Webcast Jun17
Oreilly Webcast Jun17Oreilly Webcast Jun17
Oreilly Webcast Jun17
Sean Hull
 
(WS14) Sasa Matijasic - Node.js i "novi" web
(WS14) Sasa Matijasic - Node.js i "novi" web(WS14) Sasa Matijasic - Node.js i "novi" web
(WS14) Sasa Matijasic - Node.js i "novi" web
Web::Strategija
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
Ben Lin
 
Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJS
Joseph Scott
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
Marcus Sá
 
LCA 2012: High Availability Sprint
LCA 2012: High Availability SprintLCA 2012: High Availability Sprint
LCA 2012: High Availability Sprint
hastexo
 

Was ist angesagt? (20)

Create a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDBCreate a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDB
 
Oreilly Webcast Jun17
Oreilly Webcast Jun17Oreilly Webcast Jun17
Oreilly Webcast Jun17
 
(WS14) Sasa Matijasic - Node.js i "novi" web
(WS14) Sasa Matijasic - Node.js i "novi" web(WS14) Sasa Matijasic - Node.js i "novi" web
(WS14) Sasa Matijasic - Node.js i "novi" web
 
一番速いフレンズだーれだ!!
一番速いフレンズだーれだ!!一番速いフレンズだーれだ!!
一番速いフレンズだーれだ!!
 
Webconf nodejs-production-architecture
Webconf nodejs-production-architectureWebconf nodejs-production-architecture
Webconf nodejs-production-architecture
 
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
Cassandra Summit 2014: Down with Tweaking! Removing Tunable Complexity for Ca...
 
Building a REST API with Node.js and MongoDB
Building a REST API with Node.js and MongoDBBuilding a REST API with Node.js and MongoDB
Building a REST API with Node.js and MongoDB
 
Depende, ¿de qué depende? - Plain Concepts Dev Day
Depende, ¿de qué depende? - Plain Concepts Dev Day Depende, ¿de qué depende? - Plain Concepts Dev Day
Depende, ¿de qué depende? - Plain Concepts Dev Day
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Let s Enjoy Node.js
Let s Enjoy Node.jsLet s Enjoy Node.js
Let s Enjoy Node.js
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.js
 
Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJS
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
 
5 Tips for Getting Started with Pivotal GemFire
5 Tips for Getting Started with Pivotal GemFire5 Tips for Getting Started with Pivotal GemFire
5 Tips for Getting Started with Pivotal GemFire
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
 
[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기
[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기
[5분 따라하기] 비주얼 스튜디오 C++에서 JSON 파서 설치하기
 
LCA 2012: High Availability Sprint
LCA 2012: High Availability SprintLCA 2012: High Availability Sprint
LCA 2012: High Availability Sprint
 
Yakiniku on the Cloud
Yakiniku on the CloudYakiniku on the Cloud
Yakiniku on the Cloud
 
ClojureScript@node
ClojureScript@nodeClojureScript@node
ClojureScript@node
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
 

Ähnlich wie Capistrano && SystemD

20120416 tf mms_feedback_slideshare
20120416 tf mms_feedback_slideshare20120416 tf mms_feedback_slideshare
20120416 tf mms_feedback_slideshare
Osamu Takazoe
 
Grabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the TrunkGrabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the Trunk
Harold Giménez
 

Ähnlich wie Capistrano && SystemD (20)

Linux Desktop Automation
Linux Desktop AutomationLinux Desktop Automation
Linux Desktop Automation
 
20120416 tf mms_feedback_slideshare
20120416 tf mms_feedback_slideshare20120416 tf mms_feedback_slideshare
20120416 tf mms_feedback_slideshare
 
Grabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the TrunkGrabbing the PostgreSQL Elephant by the Trunk
Grabbing the PostgreSQL Elephant by the Trunk
 
Introduction to MariaDB
Introduction to MariaDBIntroduction to MariaDB
Introduction to MariaDB
 
Joomla! Performance on Steroids
Joomla! Performance on SteroidsJoomla! Performance on Steroids
Joomla! Performance on Steroids
 
Performance_Up.ppt
Performance_Up.pptPerformance_Up.ppt
Performance_Up.ppt
 
Nagios Conference 2012 - Dan Wittenberg - Case Study: Scaling Nagios Core at ...
Nagios Conference 2012 - Dan Wittenberg - Case Study: Scaling Nagios Core at ...Nagios Conference 2012 - Dan Wittenberg - Case Study: Scaling Nagios Core at ...
Nagios Conference 2012 - Dan Wittenberg - Case Study: Scaling Nagios Core at ...
 
Netflix Keystone Pipeline at Samza Meetup 10-13-2015
Netflix Keystone Pipeline at Samza Meetup 10-13-2015Netflix Keystone Pipeline at Samza Meetup 10-13-2015
Netflix Keystone Pipeline at Samza Meetup 10-13-2015
 
Analyze Virtual Machine Overhead Compared to Bare Metal with Tracing
Analyze Virtual Machine Overhead Compared to Bare Metal with TracingAnalyze Virtual Machine Overhead Compared to Bare Metal with Tracing
Analyze Virtual Machine Overhead Compared to Bare Metal with Tracing
 
Hands-On: Deploy Remote Graphics Desktops for Content Production (CMP422) - A...
Hands-On: Deploy Remote Graphics Desktops for Content Production (CMP422) - A...Hands-On: Deploy Remote Graphics Desktops for Content Production (CMP422) - A...
Hands-On: Deploy Remote Graphics Desktops for Content Production (CMP422) - A...
 
IT MISSION & VISION
IT MISSION & VISIONIT MISSION & VISION
IT MISSION & VISION
 
20150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.420150918 klug el performance tuning-v1.4
20150918 klug el performance tuning-v1.4
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016
 
Jstorm introduction-0.9.6
Jstorm introduction-0.9.6Jstorm introduction-0.9.6
Jstorm introduction-0.9.6
 
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
Montreal On Rails 5 : Rails deployment using : Nginx, Mongrel, Mongrel_cluste...
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
 
Salt Stack pt. 2 : Configuration Management
Salt Stack pt. 2 : Configuration ManagementSalt Stack pt. 2 : Configuration Management
Salt Stack pt. 2 : Configuration Management
 
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
iThome Cloud Summit: The next generation of data center: Machine Intelligent ...
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 

Mehr von Aleksandr Simonov (7)

Dokku - your own heroku
Dokku  - your own herokuDokku  - your own heroku
Dokku - your own heroku
 
Cleaners of Caribbean
Cleaners of CaribbeanCleaners of Caribbean
Cleaners of Caribbean
 
Rupher = Ruby + Gopther
Rupher = Ruby + GoptherRupher = Ruby + Gopther
Rupher = Ruby + Gopther
 
RubyMotion: Overview and Ecosystem
RubyMotion: Overview and EcosystemRubyMotion: Overview and Ecosystem
RubyMotion: Overview and Ecosystem
 
Pivorak light
Pivorak lightPivorak light
Pivorak light
 
How to become a chef
How to become a chefHow to become a chef
How to become a chef
 
Deployment tales
Deployment talesDeployment tales
Deployment tales
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Kürzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Capistrano && SystemD