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
87
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
290
A Rusty Guide to Types and Safety
iwillspeak
0
140
Object Recognition with Grassmannian Manifolds
iwillspeak
0
92
Other Decks in Technology
See All in Technology
リクルートのエンジニア組織を下支えする 新卒の育成の仕組み
recruitengineers
PRO
2
210
開発者のための FinOps/FinOps for Engineers
oracle4engineer
PRO
2
290
AIエージェント開発のノウハウと課題
pharma_x_tech
10
5.7k
Real World Nix CI/CD編
asa1984
1
140
Postman AI Agent Builderで AI Agentic workflow のプロトタイピング / Prototyping AI Agentic Workflow with Postman AI Agent Builder
yokawasa
0
180
【Snowflake九州ユーザー会#2】BigQueryとSnowflakeを比較してそれぞれの良し悪しを掴む / BigQuery vs Snowflake: Pros & Cons
civitaspo
5
1.6k
DevinでAI AWSエンジニア製造計画 序章 〜CDKを添えて〜/devin-load-to-aws-engineer
tomoki10
0
260
プルリクエストレビューを終わらせるためのチーム体制 / The Team for Completing Pull Request Reviews
nekonenene
4
2k
Ruby on Railsで持続可能な開発を行うために取り組んでいること
am1157154
3
190
ライフステージの変化を乗り越える 探索型のキャリア選択
tenshoku_draft
2
370
AIエージェント時代のエンジニアになろう #jawsug #jawsdays2025 / 20250301 Agentic AI Engineering
yoshidashingo
9
4.4k
株式会社Awarefy(アウェアファイ)会社説明資料 / Awarefy-Company-Deck
awarefy
3
12k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
344
40k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
580
Docker and Python
trallard
44
3.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
Navigating Team Friction
lara
183
15k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Pragmatic Product Professional
lauravandoore
32
6.4k
BBQ
matthewcrist
87
9.5k
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Making the Leap to Tech Lead
cromwellryan
133
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