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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
99
JAWS ミート 2026 の「出し物」のゲームを Kiro と AI-DLC v2 で作った話
hmatsu47
PRO
0
33
ゲームで挑戦!VPC の気持ちになって IPv4/v6 パケットをルーティングしよう!
hmatsu47
PRO
0
40
続・名古屋城とデータセンター
hmatsu47
PRO
0
35
【再演】IPv6 VPC の実装パターンをいくつか
hmatsu47
PRO
0
39
名古屋城とデータセンター
hmatsu47
PRO
0
55
IPv6 に関する話
hmatsu47
PRO
0
40
さいきんの光ファイバーの話
hmatsu47
PRO
0
86
低いほうのレイヤを見てみる話
hmatsu47
PRO
0
43
Other Decks in Technology
See All in Technology
リアクションエンジニア ― 小さなリアクションから、話しかけやすい組織をつくる ―
ryuguyana
1
130
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
6
3.1k
Claude Codeで作ったアプリを安全に公開する/Built with Claude Japan 2026
yoshidashingo
0
160
Kiro Crew の Bot (続く役目を任せる窓口) | 目指せ Kiro マスター 12
inariku
PRO
0
210
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
140
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
130
生き様としてのSRE
hokkai7go
1
170
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
120
Flutter Widget Previewerで始めるUIプレビューとVRTの自動化
sakusaku3939
0
210
TSKaigi Sendai 2026 - tsgo時代のTypeScript Playgroundはどう動くか
teamlab
PRO
0
100
Lint の層を組み直した話
bengo4com
3
310
re:Invent の去年のスケジュールを公開します!
miu_crescent
PRO
0
280
Featured
See All Featured
The Curse of the Amulet
leimatthew05
3
17k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Odyssey Design
rkendrick25
PRO
2
920
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
YesSQL, Process and Tooling at Scale
rocio
174
15k
How to make the Groovebox
asonas
2
2.5k
Rails Girls Zürich Keynote
gr2m
96
14k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
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