Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
910
さくらインターネット研究所 アップデート2025年
matsumoto_r
PRO
0
960
リモートワークにおけるパッシブ疲労
matsumoto_r
PRO
6
5.6k
エンジニアのキャリアパスはどう描く? まつもとりーさんと考える後悔しないキャリア選択
matsumoto_r
PRO
10
2.5k
まつもとりーのこれまでとCOGNANOのこれから
matsumoto_r
PRO
0
390
2022年の研究所の評価制度振り返りと今後
matsumoto_r
PRO
0
940
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
医療LLMの現在地〜最新研究から社会実装までを考える〜
kento1109
1
1.7k
EIRによる不正端末のブロッキング 5G時代におけるデバイス識別と不正対策の進化
stellarcraft
0
130
SLAMはどこまで解決されたのか?
tomonom
0
1.3k
Ghost in the 7‑Zip: The Shadow of Residential Proxies Creeping into Your Life
nttcom
0
2.1k
高性能計算機クラスタを用いた大規模点群処理による森林の単木抽出と構造解析
kentaitakura
1
120
2026年度 生成AI を活用した論文執筆ガイド/ワークショップ / 2026 Academic Year Guide to Writing Papers Using Generative AI - Workshop
ks91
PRO
0
230
Anthropic が提案する LLM の内部状態を自然言語で説明可能にした Natural Language Autoencoders / Natural Language Autoencoders Produce Unsupervised Explanations of LLM Activations
shunk031
0
200
Cross-Media Human-Information Interaction
signer
PRO
0
220
CVPR2026論文紹介_VLMにとって良いvision encoderとは何か?Rethinking Model Selection in VLM Through the Lens of Gromov-Wasserstein Distance
kobayashi31
1
210
進学校の生徒にはア行の苗字が多いのか
ozekinote
0
560
Spatial Active Noise Control Based onSound Field Interpolation Incorporating Physical Constraints
skoyamalab
0
180
RS-Agent: Automating Remote Sensing Tasks through Intelligent Agent
satai
3
530
Featured
See All Featured
Fireside Chat
paigeccino
42
4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
The SEO Collaboration Effect
kristinabergwall1
1
550
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
ラッコキーワード サービス紹介資料
rakko
1
4.7M
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
Bash Introduction
62gerente
615
220k
Six Lessons from altMBA
skipperchong
29
4.5k
Odyssey Design
rkendrick25
PRO
2
800
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