Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Grow Your Unix Beard With Ruby
Search
jstorimer
October 05, 2012
Programming
4
440
Grow Your Unix Beard With Ruby
jstorimer
October 05, 2012
Tweet
Share
More Decks by jstorimer
See All by jstorimer
Grow Your Unix Beard Using Ruby
jstorimer
11
660
Taming the Unicorn
jstorimer
3
240
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
130
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
みんなでプロポーザルを書いてみた
yuriko1211
0
260
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
距離関数を極める! / SESSIONS 2024
gam0022
0
280
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
660
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Contemporary Test Cases
maaretp
0
130
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Docker and Python
trallard
40
3.1k
Become a Pro
speakerdeck
PRO
25
5k
Designing for Performance
lara
604
68k
Rails Girls Zürich Keynote
gr2m
94
13k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
GitHub's CSS Performance
jonrohan
1030
460k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
The Language of Interfaces
destraynor
154
24k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Transcript
Grow Your Unix Beard With Ruby Jesse Storimer Wednesday, 10
October, 12
@jstorimer Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Unix Ruby Wednesday, 10 October, 12
Wednesday, 10 October, 12
http://tomayko.com/writings/unicorn-is-unix Wednesday, 10 October, 12
Wednesday, 10 October, 12
:o Wednesday, 10 October, 12
Wednesday, 10 October, 12
Rack HTTP server for fast clients and Unix Wednesday, 10
October, 12
Rack HTTP server for fast clients and Unix Wednesday, 10
October, 12
Pre-forking Wednesday, 10 October, 12
forking Wednesday, 10 October, 12
Wednesday, 10 October, 12
fork() creates a new process Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
fork() returns twice Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
fork() returns twice Wednesday, 10 October, 12
fork() returns twice once, but in two processes Wednesday, 10
October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
fork() creates an exact copy of the calling process Wednesday,
10 October, 12
@hits = Array(1..5) pid = Process.fork do @hits.delete_at(1) puts "Child
hits: #@hits" end Process.wait(pid) puts "Parent hits: #@hits" Wednesday, 10 October, 12
$hits = Array(1..5) pid = Process.fork do $hits.delete_at(1) puts "Child
hits: #{$hits}" end Process.wait(pid) puts "Parent hits: #{$hits}" Wednesday, 10 October, 12
Pre-forking Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
def start open_listener_socket load_rack_app 2.times do fork { worker_loop }
end end def worker_loop loop do connection = listener_socket.accept process_client(connection) end end Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
copy on write: share memory until it’s modified Wednesday, 10
October, 12
CoW Friendly Rubies •MRI 2.0 •Ruby Enterprise Edition •MRI 1.9.3-p194-perf
Wednesday, 10 October, 12
http://bit.ly/mri-perf Wednesday, 10 October, 12
Wednesday, 10 October, 12
accept() accept() Wednesday, 10 October, 12
Wednesday, 10 October, 12
fast, efficient booting robust connection handling Wednesday, 10 October, 12
worker heartbeats self-pipe trick Wednesday, 10 October, 12
replace an instance of itself without losing any connections Wednesday,
10 October, 12
Wednesday, 10 October, 12
exec() transforms the calling process into a new process Wednesday,
10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
def reexec fork do cmd = [$0] cmd << ARGV.dup
ENV['LISTENERS'] = sockets.map(&:fileno) exec(*cmd) # exec("unicorn", "-c", "unicorn_config.rb") end end Wednesday, 10 October, 12
Wednesday, 10 October, 12
Old Master Worker Worker Wednesday, 10 October, 12
Old Master Worker Worker Worker Worker New Master Wednesday, 10
October, 12
Worker Worker New Master Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
The original Unix beards Wednesday, 10 October, 12
“[..] the Unix beard is really an extension of the
philosopher's beard, and the academic's beard.” Wednesday, 10 October, 12
Wednesday, 10 October, 12
Wednesday, 10 October, 12
Thanks! Tweet @jstorimer Email
[email protected]
Books http://workingwithcode.com Use MAGICRUBY to
save $10 Wednesday, 10 October, 12
Refs •http://www.colourlovers.com/palette/1938182/coconut_lips_RC •http://www.colourlovers.com/palette/1111659/Ninja_Rainbow •http://www.flickr.com/photos/soyunterrorista/2658174628/sizes/l/in/photostream/ •http://www.colourlovers.com/palette/1936237/Keynote_2 •http://whiteboardunicorns.com/ •http://www.flickr.com/photos/amyvdh/6003141750/sizes/o/in/photostream/ •http://www.twoideas.org/2009/07/unix-beards/ •http://www.flickr.com/photos/69er/463302758/ Wednesday,
10 October, 12