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
Transcript
38 slides
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
More Decks by Will Speak
See All by Will Speak
Opening your First Pull Request
iwillspeak
0
360
A Rusty Guide to Types and Safety
iwillspeak
0
240
Object Recognition with Grassmannian Manifolds
iwillspeak
0
120
Other Decks in Technology
See All in Technology
正しくWeb サイトを守るためのコンテンツセキュリティーポリシー
hinalin
0
600
リリースしたで終わらない。 観測できるフロントエンド開発
yamakenji24
4
1.6k
「個社」ではなく「業界」の課題を解く AI 対話開発 ー 価値を広げる設計と、価値を守るエンジニアリング ー
ivry_presentationmaterials
4
920
Ignite 2026 Security
babaneko
0
110
Welcome JXL!
dynamis
0
990
エンタープライズIAMについて - ID・権限をどう統制するか
oidfj
1
350
AIフレンドリーなGenerative UIをJSXで
uhyo
2
840
Web Performance Is a Journey [PerfNow 2026]
tammyeverts
3
180
テスト自動化の先、テスト自律化に向けて
mineo_matsuya
2
110
IVRy における AI 時代のデータプロダクトと事業開発
ivry_presentationmaterials
0
130
Well, that’s weird…
csswizardry
3
250
プラガブルで宣言的なソフトウェアファクトリーを支えるTypeScript
timakin
5
1.9k
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
370
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.3k
Designing Experiences People Love
moore
143
24k
Mobile First: as difficult as doing things right
swwweet
225
10k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
410
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Writing Fast Ruby
sferik
630
63k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
The Language of Interfaces
destraynor
163
27k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.7k