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
mrubyによるWebサーバ機能の拡張
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
MATSUMOTO Ryosuke
PRO
February 01, 2014
Research
820
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
mrubyによるWebサーバ機能の拡張
Ruby東京プレゼンテーション2014テクニカルトーク前半
MATSUMOTO Ryosuke
PRO
February 01, 2014
More Decks by MATSUMOTO Ryosuke
See All by MATSUMOTO Ryosuke
問いを起点に、社会と共鳴する知を育む場へ
matsumoto_r
PRO
0
930
さくらインターネット研究所 アップデート2025年
matsumoto_r
PRO
0
980
リモートワークにおけるパッシブ疲労
matsumoto_r
PRO
6
5.6k
エンジニアのキャリアパスはどう描く? まつもとりーさんと考える後悔しないキャリア選択
matsumoto_r
PRO
10
2.5k
まつもとりーのこれまでとCOGNANOのこれから
matsumoto_r
PRO
0
390
2022年の研究所の評価制度振り返りと今後
matsumoto_r
PRO
0
960
VUCAワールドから紐解く組織や評価制度の変遷と再設計
matsumoto_r
PRO
9
27k
コンテナの研究開発から学ぶLinuxの要素技術
matsumoto_r
PRO
2
1.6k
開発者体験をさらに向上させる 事業と研究との連携
matsumoto_r
PRO
2
2.6k
Other Decks in Research
See All in Research
敵対生成プロンプト同時探索による内省型プロンプト最適化
kinoue_smarthr
0
430
2025年度秋葉原ウォーカブルプロジェクト調査報告 「アキバらしいウォーカブル」とは何か
izumiyama_lab
1
240
大規模言語モデルは誰を覚えているか / Who Do Large Language Models Memorize?
upura
0
210
長時間動画QAにおけるマルチエージェント推論 ・SVAgent: Storyline-Guided Long Video Understanding via Cross-Modal Multi-Agent Collaboration
murakawatakuya
1
220
IA for theory
gpeyre
1
470
Ghost in the 7‑Zip: The Shadow of Residential Proxies Creeping into Your Life
nttcom
0
2.2k
[CV勉強会@関東 CVPR2026] PSDesigner: Automated Graphic Design with a Human-Like Creative Workflow / kantocv 67th CVPR 2026
shunk031
0
360
TESSERA: Temporal Embeddings of Surface Spectra for Earth Representation and Analysis
satai
2
110
MM-OVSeg: Multimodal Optical–SAR Fusion for Open-Vocabulary Segmentation in Remote Sensing
satai
3
150
SLAMはどこまで解決されたのか?
tomonom
0
1.4k
量子サマースクール2026「量子計算機アーキテクチャ分野の概観」
youten622
1
960
データサイエンティストの就労意識~2015 → 2026 一般(個人)会員アンケートより
datascientistsociety
PRO
0
990
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
540
Un-Boring Meetings
codingconduct
0
440
Building AI with AI
inesmontani
PRO
1
1.3k
How to train your dragon (web standard)
notwaldorf
96
6.9k
How to build a perfect <img>
jonoalderson
1
6.1k
Fireside Chat
paigeccino
43
4.1k
Amusing Abliteration
ianozsvald
1
330
Making the Leap to Tech Lead
cromwellryan
135
10k
A designer walks into a library…
pauljervisheath
211
25k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
760
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Transcript
mrubyによるWebサーバ機能の拡張 京都大学 松本 亮介 (技術者として)
自己紹介 • 松本亮介 – Twitter @matsumotory • 所属 – 京都大学
大学院 情報学研究科 岡部研究室 – 博士課程 D2 • 専門分野 – OS・Middlewareのセキュリティ・リソース管理・運 用技術改善・パフォーマンス・大規模対応 – http://research.matsumoto-r.jp/ 2 Ruby東京プレゼンテーション2014
Webサーバの機能拡張の分類 1. 動的コンテンツの高速処理を主な目的 • レスポンス生成をいかに効率よくするか • CGIはforkのコストが大きい • サーバプロセスが直接スクリプトを解釈 •
アプリケーションサーバの登場 2. レスポンス生成以外の内部処理が主な目的 • Webサーバそのものの振る舞いを定義 • 軽量な処理が求められる(アクセス制御等) • この目的に特化したオーバーヘッドの少ない仕組み • mruby使うには最適では? ⇒ mod_mruby開発 3 Ruby東京プレゼンテーション2014
mod_mrubyの良い点 4 • Apache2.0から2.4の最新版で動く • ApacheモジュールをRubyで書ける • オーバーヘッドが少ない • 設定が簡単
• ngx_mrubyでも同じような記述で書ける • 機能追加や改善要望を出しやすい 松本亮介,岡部 寿男, mod_mruby: スクリプト言語で高速かつ省メモリに拡張可能なWebサーバの機能拡張 支援機構, 情報処理学会第6回インターネットと運用技術シンポジウム, 2013年12月. 優秀論文賞受賞 Ruby東京プレゼンテーション2014
Apache httpd 設定例 # コンパイル方式: コードの変更可 <Location /mruby-test> mrubyHandlerMiddle /path/to/test.rb
</Location> # キャッシュ方式: コード変更不可だが高速に動作 <Location /mruby-test-cache> mrubyHandlerMiddle /path/to/test.rb cache </Location> Ruby東京プレゼンテーション2014 5
nginx 設定例 # コンパイル方式: コードの変更可 Location /mruby-test { mruby_contenx_handler /path/to/test.rb;
} # キャッシュ方式: コード変更不可だが高速に動作 Location /mruby-test-cache { mruby_contenx_handler /path/to/test.rb cache; } Ruby東京プレゼンテーション2014 6
Reverse Proxy by mod_mruby Ruby東京プレゼンテーション2014 7
BasicAuth with Redis by mod_mruby Ruby東京プレゼンテーション2014 8
リソース制御として応用 r = Apache::Request.new if r.user == “matsumoto_r” cpu =
Cgroup::CPU.new “cpu_group” # CPUを10%に制御したい場合 cpu.cfs_quota_us = 10000 cpu.create cpu.attach end 松本亮介, 岡部寿男, リクエスト単位で仮想的にコンピュータリソースを分離するWebサーバのリソース制御 アーキテクチャ, 情報処理学会研究報告 Vol.2013-IOT-23, No.4, 2013年9月. 学生奨励賞受賞 Ruby東京プレゼンテーション2014 9
まとめ • レスポンス生成処理以外の内部処理を目的 • mrubyによってオーバーヘッドを低減 • Rubyで複数のWebサーバの振る舞いを記述 • Webサービスの各種サーバの連携に最適 •
Web以外のサーバソフトウェアにも応用可能 – メールサーバ、ファイルサーバ… 10 Ruby東京プレゼンテーション2014