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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
jstorimer
October 05, 2012
Programming
540
4
Share
Grow Your Unix Beard With Ruby
jstorimer
October 05, 2012
More Decks by jstorimer
See All by jstorimer
Grow Your Unix Beard Using Ruby
jstorimer
11
710
Taming the Unicorn
jstorimer
3
260
Other Decks in Programming
See All in Programming
From Formal Specification to Property Based Test
ohbarye
0
2.4k
tRPCの概要と少しだけパフォーマンス
misoton665
2
270
Road to RubyKaigi: Play Hard(ware)
makicamel
1
560
AIを導入する前にやるべきこと
negima
2
340
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
200
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
140
GoogleCloudとterraform完全に理解した
terisuke
1
190
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
AIと共に生きる技術選定 2026
sgash708
0
130
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
440
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
140
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
330
Featured
See All Featured
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Color Theory Basics | Prateek | Gurzu
gurzu
0
310
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
210
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
Side Projects
sachag
455
43k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
280
RailsConf 2023
tenderlove
30
1.4k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
130
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
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