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
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
97
JAWS ミート 2026 の「出し物」のゲームを Kiro と AI-DLC v2 で作った話
hmatsu47
PRO
0
31
ゲームで挑戦!VPC の気持ちになって IPv4/v6 パケットをルーティングしよう!
hmatsu47
PRO
0
35
続・名古屋城とデータセンター
hmatsu47
PRO
0
33
【再演】IPv6 VPC の実装パターンをいくつか
hmatsu47
PRO
0
38
名古屋城とデータセンター
hmatsu47
PRO
0
49
IPv6 に関する話
hmatsu47
PRO
0
39
さいきんの光ファイバーの話
hmatsu47
PRO
0
83
低いほうのレイヤを見てみる話
hmatsu47
PRO
0
40
Other Decks in Technology
See All in Technology
Deep Data Security 機能解説
oracle4engineer
PRO
3
970
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
0
140
Don't write the architecture only in the prompt.
neohsu
0
280
Claude for Google Workspaces ポン出し/claude-for-google-workspace-slide-conversion
emiki
0
13k
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
110
AI駆動開発におけるハーネスエンジニアリングの勘所
tsukuboshi
1
890
Adversary Infrastructure Hunting101
disconinja
0
180
構造で守らせる データ・法務・セキュリティ・開発チームとつくる AI時代のデータガバナンスとデータ基盤のリアル
legalontechnologies
PRO
2
700
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
100
AX時代の自治体支援リソース再配分と役割分担の再構成:戦略とロードマップ(概要)
sishi2026
0
140
AI時代の開発はウォーターフォールに回帰する? / development-with-ai-back-to-wf
okamototakuyasr2
0
160
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
470
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
610
How STYLIGHT went responsive
nonsquared
100
6.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
It's Worth the Effort
3n
188
29k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
270
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
290
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Being A Developer After 40
akosma
PRO
92
590k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
370
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
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