Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
320
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
業務のトイルをバスターせよ 〜AI時代の生存戦略〜
staka121
PRO
2
220
AIの長期記憶と短期記憶の違いについてAgentCoreを例に深掘ってみた
yakumo
4
460
Strands Agents × インタリーブ思考 で変わるAIエージェント設計 / Strands Agents x Interleaved Thinking AI Agents
takanorig
3
890
OCI Oracle Database Services新機能アップデート(2025/09-2025/11)
oracle4engineer
PRO
1
220
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
4
1.1k
IAMユーザーゼロの運用は果たして可能なのか
yama3133
2
500
エンジニアリングをやめたくないので問い続ける
estie
2
1.2k
AI時代の新規LLMプロダクト開発: Findy Insightsを3ヶ月で立ち上げた舞台裏と振り返り
dakuon
0
260
コンテキスト情報を活用し個社最適化されたAI Agentを実現する4つのポイント
kworkdev
PRO
1
1.6k
Power of Kiro : あなたの㌔はパワステ搭載ですか?
r3_yamauchi
PRO
0
190
生成AI活用の型ハンズオン〜顧客課題起点で設計する7つのステップ
yushin_n
0
250
mairuでつくるクレデンシャルレス開発環境 / Credential-less development environment using Mailru
mirakui
5
560
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
470k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
320
Building Flexible Design Systems
yeseniaperezcruz
330
39k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
87
30 Presentation Tips
portentint
PRO
1
160
Building an army of robots
kneath
306
46k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
33
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
110
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
4 Signs Your Business is Dying
shpigford
186
22k
The Curious Case for Waylosing
cassininazir
0
190
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
60
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