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
930
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
950
さくらインターネット研究所 アップデート2025年
matsumoto_r
PRO
0
1k
リモートワークにおけるパッシブ疲労
matsumoto_r
PRO
6
5.6k
エンジニアのキャリアパスはどう描く? まつもとりーさんと考える後悔しないキャリア選択
matsumoto_r
PRO
10
2.5k
まつもとりーのこれまでとCOGNANOのこれから
matsumoto_r
PRO
0
400
2022年の研究所の評価制度振り返りと今後
matsumoto_r
PRO
0
990
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
「いつか使う」の「いつか」は来ない 〜AI駆動開発における「作らない」判断について〜
ikki0006
0
180
会社説明資料_最新版
demaecan
0
32k
Agent Harnessはどう作る?事例から学ぶAI Agentの設計思想
sergicalsix
0
230
[JAWS Festa 2026]一番いい仕事は、請求書に現れない / jawsfesta2026
sh_fk2
2
420
Reticulum, le réseau cypherpunk dont vous avez besoin !
rlifchitz
0
120
IBC 2026 動画技術関連レポート / IBC 2026 Report
cyberagentdevelopers
PRO
2
450
続・ソフトウェアアーキテクトのための意思決定術: Decision Readiness, Revisited — When AI Changes the Economics of Software Architecture
snoozer05
PRO
9
2.8k
Kiro を使うコツ (頼み方、覚えさせ方、任せ方) | 目指せ Kiro マスター 09
inariku
PRO
3
110
内製アプリとClaudeスキルのセキュリティチェック、 Backlogの課題で回しています。
ayaka_egaaa
0
160
AIエージェントの監視、思考を見るか行動を見るか / Monitoring AI Agents: Thoughts or Actions
yusukeshimizu
2
180
2026 Apache Flink Community Checkpoint
rmetzger
0
200
cdkd (CDK Direct)
gotok365
4
280
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
56
10k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
480
Rails Girls Zürich Keynote
gr2m
96
14k
Un-Boring Meetings
codingconduct
0
490
Balancing Empowerment & Direction
lara
6
1.4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
610
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
60k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
The browser strikes back
jonoalderson
0
1.9k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
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