Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Mongrel 2
Search
Will Speak
March 30, 2016
Technology
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mongrel 2
A quick introduction to the Mongrel 2 webserver protocol.
Will Speak
March 30, 2016
More Decks by Will Speak
See All by Will Speak
Opening your First Pull Request
iwillspeak
0
350
A Rusty Guide to Types and Safety
iwillspeak
0
230
Object Recognition with Grassmannian Manifolds
iwillspeak
0
120
Other Decks in Technology
See All in Technology
メルペイ 会計システム概要と歴史
mewuto
0
200
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
400
不可逆な意思決定を避けながら10億超の顧客データを AI Ready にするデータ基盤設計
baseballyama
1
280
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
460
FOSS4Gを活用した自治体業務DXの試み
470715
0
150
AI時代のAPI開発を加速する品質ガードレール / API Quality Guardrails in the AI Era
yokawasa
0
180
プロダクト価値を、 チームが使える判断軸に変える
vivion
0
140
生成AIで高い生産性を求められて、 悩み、乗り越えた話
mot_techtalk
2
150
Datadog の学び方 - あるいは、オブザーバビリティを学ぶとは何か
mananyuki
1
540
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.3k
12 個 Tool と、 4,096 Token
hlum
0
110
全人類(ほぼ)AWS Organizations の上でAWSを利用している、その世界を知る話
htan
1
130
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
Mind Mapping
helmedeiros
1
400
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
Deep Space Network (abreviated)
tonyrice
0
360
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
480
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Music & Morning Musume
bryan
48
7.4k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
630
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
370
Accessibility Awareness
sabderemane
1
240
New Earth Scene 8
popppiees
4
2.7k
Transcript
MONGREL 2 Will Speak
A STORY or how Mongrel 2 came to be
RAGEL in the beginning there was the state machine compiler
RAGEL STATE MACHINE COMPILER ⇒ Compiles state machines into code
tokenising, regex & parser combines
fast and efficient parsing
MONGREL then came a
Ruby webserver Rock solid HTTP parser Easily scalable
ØMQ along came a whole lot of nothing
Provides a brokerless messaging architecture where clients and servers communicate
via a Berkeley Sockets style interface “
a standard socket looks just like
a standard socket far more than
MONGREL 2 Add them all together and you get
fast and efficient parsing tried and tested HTTP support brokerless
scalability from Mongrel Ragel ZeroMQ
fast and efficient parsing tried and tested HTTP support brokerless
scalability from Mongrel Ragel ZeroMQ
fast and efficient parsing tried and tested HTTP support brokerless
scalability from Mongrel Ragel ZeroMQ
synchronous http requests offloads
persistent state async protocols &
A PROTOCOL or what Mongrel 2 can do for us
REQUEST/RESPONSE a millisecond in the life of a mongre2 request
None
Request 1 Server IIS-01 Headers { “method”: “post”, … }
Path /LockedQueueNoSql Body { “name”: “willspeak”, “affiliates”: [ …. ]}
Request 1 Server IIS-01 Headers { “method”: “post”, … }
Path /LockedQueueNoSql Body { “name”: “willspeak”, “affiliates”: [ …. ]}
Request 1 Server IIS-01 Response [ { … }, {
… }, …. ]
Request 1 Server IIS-01 Response [ { … }, {
… }, …. ]
None
None
None
None
None
NETSTRINGS simple data serialisation
12:hello world!, prefixed by length data encoded as UTF-8 assemble
the delimiter committee
PACKETS inside the envelope
12:hello world!, prefixed by length data encoded as UTF-8 assemble
the delimiter committee
REQUEST PACKET FORMAT IIS-01 1 hello/world 2:{},4:body, webserver id requested
path numeric request id netstring encoded json request headers netstring encoded request body
RESPONSE PACKET FORMAT IIS-01 1:1, hello Mongrel2 webserver id response
data space-separated netstring of response ids
DEMO what you’ve all been waiting for
USEFUL LINKS Mongrel 2 http://mongrel2.org/ https://github.com/mongrel2/mongrel2 Ragel http://www.colm.net/open-source/ragel/ http://zedshaw.com/archive/ragel-state-charts/ ØMQ
http://zeromq.org/ http://netmq.readthedocs.org/ netstrings https://cr.yp.to/proto/netstrings.txt