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
Trusterd: HTTP/2 Web Server scripting with mruby
Search
MATSUMOTO Ryosuke
PRO
January 28, 2015
Technology
920
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Trusterd: HTTP/2 Web Server scripting with mruby
mrubyで振る舞いを記述可能な高速に動作するHTTP/2 Webサーバ
MATSUMOTO Ryosuke
PRO
January 28, 2015
More Decks by MATSUMOTO Ryosuke
See All by MATSUMOTO Ryosuke
問いを起点に、社会と共鳴する知を育む場へ
matsumoto_r
PRO
0
930
さくらインターネット研究所 アップデート2025年
matsumoto_r
PRO
0
990
リモートワークにおけるパッシブ疲労
matsumoto_r
PRO
6
5.6k
エンジニアのキャリアパスはどう描く? まつもとりーさんと考える後悔しないキャリア選択
matsumoto_r
PRO
10
2.5k
まつもとりーのこれまでとCOGNANOのこれから
matsumoto_r
PRO
0
390
2022年の研究所の評価制度振り返りと今後
matsumoto_r
PRO
0
970
VUCAワールドから紐解く組織や評価制度の変遷と再設計
matsumoto_r
PRO
8
27k
コンテナの研究開発から学ぶLinuxの要素技術
matsumoto_r
PRO
2
1.6k
開発者体験をさらに向上させる 事業と研究との連携
matsumoto_r
PRO
2
2.6k
Other Decks in Technology
See All in Technology
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
300
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
390
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
5
1.3k
Refining Active Record
shugo
0
170
その Valkey 使いこなしていますか?
onk
PRO
5
1.6k
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
290
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
7
5.1k
今さら理解するウェブフォントver.2026
takanorip
3
920
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
200
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
140
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
300
トークン化預金DCJPYの取り組みと活用ユースケース
finengine
0
180
Featured
See All Featured
Fireside Chat
paigeccino
43
4.1k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
540
How to build a perfect <img>
jonoalderson
1
6.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
550
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.3k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
Discover your Explorer Soul
emna__ayadi
2
1.3k
Transcript
5SVTUFSE NSVCZͰৼΔ͍Λهड़Մೳͳ ߴʹಈ࡞͢Δ)5518FCαʔό দຊ྄հ
࣍ • 5SVTUFSEͷಛ • 3VCZΛద༻ͨ͠Օॴ • 3VCZΛ׆༻ͨ͜͠ͱʹΑΔޮՌ • ࣾձʹٴ΅͢Өڹ 第7回フクオカRuby大賞
本審査 2
5SVTUFSEͷಛ 第7回フクオカRuby大賞 本審査 3
5SVTUFSE • )5518FCαʔό • 3VCZͰઃఆ͕ॻ͚Δ • 3VCZͰػೳ֦ுͰ͖Δ • αʔόػೳΛΞϓϦʹࠐΈՄೳ •
ඇৗʹߴʹಈ࡞͢Δ 第7回フクオカRuby大賞 本審査 4
ߴʢ݄ݱࡏʣ HTTP/2 Server \ size of content 6 bytes 4,096
bytes ngh)pd(single thread) 148,841 73,812 ngh)pd(mul= thread) 347,152 104,244 =ny-‐ngh)pd(single thread) 190,223 82,047 trusterd(single thread) 204,769 92,068 trusterd(mul= process) 509,059 134,542 H2O(single thread) 216,453 112,356 H2O(mul= thread) 379,623 146,343 第7回フクオカRuby大賞 本審査 5 HTTP/1 Server \ size of content 6 bytes 4,096 bytes nginx(single thread) 21,708 22,366 nginx(mul= process) 67,349 56,203 ࢀߟɿಉڥͷ)551ͷ݁Ռɹ ※ https://github.com/matsumoto-r/trusterd#benchmarks
։ൃͷܦҢ • աڈʹNPE@NSVCZOHY@NSVCZΛ։ൃ – ߴɾলϝϞϦʹ8FCαʔόΛػೳ֦ு – 3VCZͰ͋ΔఔৼΔ͍Λهड़Մೳ – ಈతͳઃఆɾ֦ுΛ3VCZͰهड़Մೳ •
NPE@NSVCZOHY@NSVCZͷଥڠ – ੑೳ͕"QBDIFOHJOYʹґଘ – ઃఆͷ֦ு࣮͕Ϟδϡʔϧ༷ʹґଘ – ݁ہຊମͷઃఆ͔ΒಀΕΒΕͳ͍ɾࠞࡏ 第7回フクオカRuby大賞 本審査 6
͔Β࡞Ζ͏ • ޙΛݟӽͯ͠ • Ͳ͏ͤͳΒ)5518FCαʔό • શͯͷઃఆ֦ுΛ3VCZͰॻ͚Δ • NSVCZʹ࠷దԽ͞Εͨ8FCαʔό •
ػೳͷͱଞΞϓϦͷࠐΈ 第7回フクオカRuby大賞 本審査 7
3VCZΛద༻ͨ͠Օॴ 第7回フクオカRuby大賞 本審査 8
5SVTUFSE • )5518FCαʔό • 3VCZͰઃఆ͕ॻ͚Δ • 3VCZͰػೳ֦ுͰ͖Δ • αʔόػೳΛΞϓϦʹࠐΈՄೳ •
ඇৗʹߴʹಈ࡞͢Δ 第7回フクオカRuby大賞 本審査 9
3VCZͰઃఆ͕ॻ͚Δ 第7回フクオカRuby大賞 本審査 10 root_dir = "/usr/local/trusterd" s = HTTP2::Server.new({
:port => 8080, :document_root => “#{root_dir}/htdocs”, :server_name => “Trusterd/0.0.1”, :tls => false, :worker => “auto”, }) s.run
3VCZͰػೳ֦ுͰ͖Δ 第7回フクオカRuby大賞 本審査 11 s.set_map_to_strage_cb { if s.r.uri == ”/”
s.r.filename = "#{root_dir}/index.html” end if s.r.uri =~ /^.*\.rb$/ s.enable_mruby fi } s.set_content_cb { s.r.rputs "hello trusterd world from cb” }
3VCZͰػೳ֦ுͰ͖Δ 第7回フクオカRuby大賞 本審査 12 f = File.open "#{root_dir}/logs/access.log", "a" s.set_logging_cb
{ f.write "client_ip:'#{s.conn.client_ip}' date:'#{s.r.date}' status:#{s.r.status} content_length:#{s.r.content_length} uri:'#{s.r.uri}' filename:'#{s.r.filename}' user_agent:'#{s.r.user_agent}'\n" } s.set_access_check_cb { s.r.set_status 403 if deny }
3VCZͰػೳ֦ுͰ͖Δ 第7回フクオカRuby大賞 本審査 13 s.set_map_to_strage_cb { # Experiment: reverse proxy
# client <=HTTP/2=> trusterd <=HTTP/1=> Upstream if s.r.uri == /^/upstream(¥/.*)/ s.upstream_uri = $1 s.upstream = “http://127.0.0.1:8081” end }
αʔόػೳΛΞϓϦʹࠐΈ • NSVCZIUUQͱͯ͠Մೳ • NSVCZܦ༝ͰࠐΈՄೳ • ϛυϧΣΞΞϓϦͰ)551௨৴ • NSVCZͷࡌΔσόΠεͰ)551௨৴ 第7回フクオカRuby大賞
本審査 14
3VCZΛ׆༻ͨ͜͠ͱʹΑΔޮՌ 第7回フクオカRuby大賞 本審査 15
ߴ͍ϨϕϧͰੜ࢈ੑͱੑೳͷཱ྆ • ैདྷͷಠࣗઃఆॻ͖ʹ͔ͬͨ͘ – ੩తͳઃఆʹͳΓ͕ͪ – ಠࣗ%4-͍ʹ͍͘ – ࠓޙͷ8FCαʔϏεͷߴԽʹ͍͚ͳ͍ • NSVCZͰ౷Ұతʹಈతͳઃఆهड़ – )551ΛΞϓϦσόΠεʹࠐΊΔ – ຊମ$ݴޠͰ࣮͓ͯ͠Γඇৗʹߴ
– ઃఆͷ3VCZԽ͕࣮͍͢͠ɾअຐ͠ͳ͍ 第7回フクオカRuby大賞 本審査 16
ࣾձʹٴ΅͢Өڹ 第7回フクオカRuby大賞 本審査 17
NSVCZͰઃఆΛॻ͘ΞϓϦͷීٴ • ߴ͔ͭ3VCZʹΑΔಈతͳઃఆ – 8FCܥΤϯδχΞ͕ѻ͍͍͢ – ։ൃऀӡ༻ऀͲ͜Ͱ3VCZΛֶΔ – 3VCZNSVCZͷීٴʹߩݙ • )551ϓϩτίϧΛ༰қʹར༻Մೳ – $ΞϓϦσόΠεʹػೳࠐΈ – ϓϩτίϧ)551ͰઃఆNSVCZ
– )551ͷීٴʹߩݙ 第7回フクオカRuby大賞 本審査 18