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
Mongrel 2
Search
Will Speak
March 30, 2016
Technology
0
95
Mongrel 2
A quick introduction to the Mongrel 2 webserver protocol.
Will Speak
March 30, 2016
Tweet
Share
More Decks by Will Speak
See All by Will Speak
Opening your First Pull Request
iwillspeak
0
320
A Rusty Guide to Types and Safety
iwillspeak
0
180
Object Recognition with Grassmannian Manifolds
iwillspeak
0
98
Other Decks in Technology
See All in Technology
Node vs Deno vs Bun 〜推しランタイムを見つけよう〜
kamekyame
1
190
CQRS/ESになぜアクターモデルが必要なのか
j5ik2o
0
460
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
I tried making a solo advent calendar!
zzzzico
0
130
迷わない!AI×MCP連携のリファレンスアーキテクチャ完全ガイド
cdataj
0
180
スクラムマスターが スクラムチームに入って取り組む5つのこと - スクラムガイドには書いてないけど入った当初から取り組んでおきたい大切なこと -
scrummasudar
1
1.2k
チームで安全にClaude Codeを利用するためのプラクティス / team-claude-code-practices
tomoki10
5
2k
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
260
歴史から学ぶ、Goのメモリ管理基礎
logica0419
10
2k
Oracle Cloud Infrastructure:2025年12月度サービス・アップデート
oracle4engineer
PRO
0
190
あの夜、私たちは「人間」に戻った。 ── 災害ユートピア、贈与、そしてアジャイルの再構築 / 20260108 Hiromitsu Akiba
shift_evolve
PRO
0
380
製造業から学んだ「本質を守り現場に合わせるアジャイル実践」
kamitokusari
0
260
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
The untapped power of vector embeddings
frankvandijk
1
1.5k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
1
340
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.2k
How to make the Groovebox
asonas
2
1.9k
First, design no harm
axbom
PRO
1
1.1k
Building Adaptive Systems
keathley
44
2.9k
Exploring anti-patterns in Rails
aemeredith
2
220
Technical Leadership for Architectural Decision Making
baasie
0
200
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
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