$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mongrel 2
Search
Will Speak
March 30, 2016
Technology
0
94
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
310
A Rusty Guide to Types and Safety
iwillspeak
0
170
Object Recognition with Grassmannian Manifolds
iwillspeak
0
98
Other Decks in Technology
See All in Technology
32のキーワードで学ぶ はじめての耐量子暗号(PQC) / Getting Started with Post-Quantum Cryptography in 32 keywords
quiver
0
300
AI/MLのマルチテナント基盤を支えるコンテナ技術
pfn
PRO
5
780
新 Security HubがついにGA!仕組みや料金を深堀り #AWSreInvent #regrowth / AWS Security Hub Advanced GA
masahirokawahara
0
130
useEffectってなんで非推奨みたいなこと言われてるの?
maguroalternative
10
6.4k
シンプルを極める。アンチパターンなDB設計の本質
facilo_inc
2
1.6k
生成AIでテスト設計はどこまでできる? 「テスト粒度」を操るテーラリング術
shota_kusaba
0
310
「Managed Instances」と「durable functions」で広がるAWS Lambdaのユースケース
lamaglama39
0
180
乗りこなせAI駆動開発の波
eltociear
1
620
モバイルゲーム開発におけるエージェント技術活用への試行錯誤 ~開発効率化へのアプローチの紹介と未来に向けた展望~
qualiarts
0
540
手動から自動へ、そしてその先へ
moritamasami
0
260
M5UnifiedとPicoRubyで楽しむM5シリーズ
kishima
0
120
ML PM Talk #1 - ML PMの分類に関する考察
lycorptech_jp
PRO
1
650
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Producing Creativity
orderedlist
PRO
348
40k
Code Review Best Practice
trishagee
73
19k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Embracing the Ebb and Flow
colly
88
4.9k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Automating Front-end Workflow
addyosmani
1371
200k
How to train your dragon (web standard)
notwaldorf
97
6.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
Being A Developer After 40
akosma
91
590k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
88
A designer walks into a library…
pauljervisheath
210
24k
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