SlideShare a Scribd company logo
Капістрано Та СістемД
Олександр Сімонов
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
Capistrano && SystemD
Memory Usage After One Week
PostgreSQL - 550Mb
Puma Cluster - 2Gb
Sidekiq - 1Gb
Total: 550Mb DB + 6GB Rails App
Capistrano && SystemD
Memory Usage After One Month
PostgreSQL - 570Mb
Puma Cluster - 5Gb
Sidekiq - 2,5Gb
Total: 570Mb DB + 15GB Rails App
Capistrano && SystemD
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?!
Capistrano && SystemD
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
Capistrano && SystemD
Capistrano && SystemD
Capistrano && SystemD
Capistrano && SystemD
systemd + cgroups
Process supervising
Resource management
Dependency management
Logs management
Capistrano && SystemD
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!
Capistrano && SystemD
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….
Capistrano && SystemD
Questions
GitHub: @simonoff
Twitter: @ceo_simonov
FB: @ceosimonov
Website: https://amoniac.eu

More Related Content

PPTX
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
PDF
Ansible
PDF
[Js hcm] Deploying node.js with Forever.js and nginx
PPTX
Introduction to using Grunt & Bower with WordPress theme development
PDF
KOWAZA for mackerel
PPTX
Herramientas front
PDF
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
PDF
Modernizing Your WordPress Workflow with Grunt & Bower
When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
Ansible
[Js hcm] Deploying node.js with Forever.js and nginx
Introduction to using Grunt & Bower with WordPress theme development
KOWAZA for mackerel
Herramientas front
OSGi in Action - How we use OSGi to build Open Liberty - Alasdair Nottingham ...
Modernizing Your WordPress Workflow with Grunt & Bower

What's hot (19)

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

More from Aleksandr Simonov (7)

PDF
Dokku - your own heroku
PDF
Cleaners of Caribbean
PDF
Rupher = Ruby + Gopther
PDF
RubyMotion: Overview and Ecosystem
PDF
Pivorak light
PDF
How to become a chef
PDF
Deployment tales
Dokku - your own heroku
Cleaners of Caribbean
Rupher = Ruby + Gopther
RubyMotion: Overview and Ecosystem
Pivorak light
How to become a chef
Deployment tales
Ad

Recently uploaded (20)

PPTX
Modernising the Digital Integration Hub
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Tartificialntelligence_presentation.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Chapter 5: Probability Theory and Statistics
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
A comparative study of natural language inference in Swahili using monolingua...
Modernising the Digital Integration Hub
OMC Textile Division Presentation 2021.pptx
cloud_computing_Infrastucture_as_cloud_p
Web App vs Mobile App What Should You Build First.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
1 - Historical Antecedents, Social Consideration.pdf
Tartificialntelligence_presentation.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Chapter 5: Probability Theory and Statistics
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Getting Started with Data Integration: FME Form 101
Getting started with AI Agents and Multi-Agent Systems
NewMind AI Weekly Chronicles – August ’25 Week III
Group 1 Presentation -Planning and Decision Making .pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
A contest of sentiment analysis: k-nearest neighbor versus neural network
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Zenith AI: Advanced Artificial Intelligence
A comparative study of natural language inference in Swahili using monolingua...

Capistrano && SystemD