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
EFSへの書き込み速度を上げる(小ネタ)
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
hmatsu47
PRO
June 22, 2021
Technology
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
EFSへの書き込み速度を上げる(小ネタ)
JAWS-UG 浜松 AWS 勉強会 2021#6 2021/06/25
hmatsu47
PRO
June 22, 2021
More Decks by hmatsu47
See All by hmatsu47
中小企業に就職して転職せず30年。結果どうなった?
hmatsu47
PRO
0
95
JAWS ミート 2026 の「出し物」のゲームを Kiro と AI-DLC v2 で作った話
hmatsu47
PRO
0
30
ゲームで挑戦!VPC の気持ちになって IPv4/v6 パケットをルーティングしよう!
hmatsu47
PRO
0
33
続・名古屋城とデータセンター
hmatsu47
PRO
0
30
【再演】IPv6 VPC の実装パターンをいくつか
hmatsu47
PRO
0
35
名古屋城とデータセンター
hmatsu47
PRO
0
45
IPv6 に関する話
hmatsu47
PRO
0
33
さいきんの光ファイバーの話
hmatsu47
PRO
0
80
低いほうのレイヤを見てみる話
hmatsu47
PRO
0
38
Other Decks in Technology
See All in Technology
Active Record Connection Adaptersにおける長年の課題に再び取り組む
yahonda
0
200
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
180
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
890
Rust で関数型ドメインモデリング
takonda
0
170
Rustuna: Rustによる高速なOptuna実装
pfn
PRO
0
200
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
180
WasmをRustにする
sansantech
PRO
0
260
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
180
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
Kiro Crewで「みのるん式」仕事術やってみた
minorun365
PRO
1
280
How to Design Configuration for Rails Applications
willnet
1
830
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
140
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
30 Presentation Tips
portentint
PRO
1
430
Believing is Seeing
oripsolob
1
240
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Designing Experiences People Love
moore
143
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Why Our Code Smells
bkeepers
PRO
340
58k
Transcript
EFS への書き込み速度を上げる(小ネタ) JAWS-UG 浜松 AWS 勉強会 2021#6 2021/06/25 まつひさ(hmatsu47)
自己紹介 松久裕保(@hmatsu47) https://qiita.com/hmatsu47 名古屋で Web インフラのお守り係をしています (ほかに書くことがなくなったので省略) 2
今日の内容 • EFS とは • EFS は書き込みが遅い ◦ Amazon Linux
2 の /usr/ を普通に rsync ▪ 1 ゾーンで約 15 倍、標準(1 リージョン)で約 29 倍遅い • 処理を並列化してみると… ◦ xargs を使って並列で rsync ▪ 1 インスタンスの EC2 からのアクセスでも高速化が可能 3
EFS とは • フルマネージドの分散・共有ファイルシステム ◦ https://aws.amazon.com/jp/efs/ • NFSv4 プロトコルでアクセス可能 ◦
NFS v4.0 および v4.1 をサポート • 高可用性・高耐久性 ◦ 1 ゾーンストレージクラスと標準ストレージクラス ▪ 1 ゾーン内または 1 リージョン内で冗長化 ◦ 耐久性は 99.999999999% 4
EFS の弱点 • とにかく書き込みが遅い ◦ 分散・共有ファイルシステムなので… • 例えば、Amazon Linux 2
で普通に rsync してみると ◦ m5.large で /usr/(1.1GB)から別のファイルシステムにコピー rsync -avz /usr/ /mnt/【コピー先】/usr/ ◦ 対 EBS(gp3 IOPS:3000) : 00 分 54 秒 ◦ 対 EFS(1 ゾーン・バースト) : 13 分 51 秒(15.4 倍遅い) ◦ 対 EFS(標準・同) : 25 分 58 秒(28.9 倍遅い) 5
処理を並列化してみる • rsync を xargs と組み合わせる ls -1 /usr |
xargs -I {arg} -P 【並列数】 -n 1 rsync -avz /usr/{arg} /mnt/【コピー先】/usr/ 6 コピー先 通常(1 並列) 2 並列 4 並列 EBS(gp3 IOPS:3000) 00:54 - 00:42 - 00:39 - EFS(1 ゾーン・バースト) 13:51 15.4 倍遅い 09:09 13.1 倍遅い 06:23 9.8 倍遅い EFS(標準・同) 25:58 28.9 倍遅い 16:35 23.7 倍遅い 11:28 17.6 倍遅い
処理を並列化してみる 7
補足など • 並列数をもっと増やすとさらに高速化する ◦ m5.large (2vCPU)のように vCPU 数の少ないインスタンスで も 10
~ 16 並列ぐらいは行ける ▪ /usr/ 直下のディレクトリの数が少なく中のファイル容量や数のバランスが 悪いので今回は 4 並列まで(バランスが良いと線形に性能向上する) • 一部の NFS クライアントでは並列化の効果が出ない ◦ RHEL 6 など ◦ 処理を直列化してしまうため 8
参考:読み取り(find)並列化 • 通常 : find -type f -exec cat {}
\; • 並列 : find -type f -print0 | xargs -0 -I {arg} -P 【並列数】 -n 1 cat {arg} ※都度 OS を再起動し、OS のディスクキャッシュがクリアされた状態で計測 9 読み取り対象 通常 (1 並列) 2 並列 4 並列 8 並列 EBS(gp3 IOPS:3000) 00:46 00:24 00:17 00:16 EFS(1 ゾーン・バースト) 02:43 01:05 00:36 00:28 EFS(標準・同) 02:47 01:10 00:35 00:26
参考:読み取り(find)並列化 10
まとめ • 処理を並列化すると速くなる ◦ 1 インスタンスからのアクセスでも ◦ vCPU 数が少なくても ▪
一部 OS で速くならない点には注意 • 書き込みと読み取りでは少し傾向が違う ◦ EBS との差は読み取りのほうが小さい ◦ 読み取りでは 1 ゾーンと標準の性能差はない ▪ 帯域の上限に達するまでは 11