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
バッファキャッシュ
Search
Satoru Takeuchi
PRO
December 29, 2020
Technology
0
360
バッファキャッシュ
以下動画のテキストです。
https://youtu.be/pXpVDAqLpHA
Satoru Takeuchi
PRO
December 29, 2020
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
「Linux」という言葉が指すもの
sat
PRO
3
95
APIとABIの違い
sat
PRO
5
62
ファイルシステムへのアクセス方法
sat
PRO
0
26
ファイルシステム
sat
PRO
1
34
低レイヤソフトウェア技術者が YouTuberとして食っていこうとした話
sat
PRO
7
6.1k
ポーリングと割り込み
sat
PRO
1
80
Rook: Intro and Deep Dive With Ceph
sat
PRO
1
140
会社員しながら本を書いてきた知見の共有
sat
PRO
3
880
デバイスにアクセスするデバイスファイル
sat
PRO
1
62
Other Decks in Technology
See All in Technology
MCPで変わる Amebaデザインシステム「Spindle」の開発
spindle
PRO
3
3.2k
Django's GeneratedField by example - DjangoCon US 2025
pauloxnet
0
120
5分でカオスエンジニアリングを分かった気になろう
pandayumi
0
220
allow_retry と Arel.sql / allow_retry and Arel.sql
euglena1215
1
160
ブロックテーマ時代における、テーマの CSS について考える Toro_Unit / 2025.09.13 @ Shinshu WordPress Meetup
torounit
0
110
「何となくテストする」を卒業するためにプロダクトが動く仕組みを理解しよう
kawabeaver
0
380
今!ソフトウェアエンジニアがハードウェアに手を出すには
mackee
11
4.7k
Android Audio: Beyond Winning On It
atsushieno
0
100
新アイテムをどう使っていくか?みんなであーだこーだ言ってみよう / 20250911-rpi-jam-tokyo
akkiesoft
0
180
自作JSエンジンに推しプロポーザルを実装したい!
sajikix
1
170
機械学習を扱うプラットフォーム開発と運用事例
lycorptech_jp
PRO
0
230
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
8.7k
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
51k
Code Review Best Practice
trishagee
70
19k
Building Adaptive Systems
keathley
43
2.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
920
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
The Cult of Friendly URLs
andyhume
79
6.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Making Projects Easy
brettharned
117
6.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
The Art of Programming - Codeland 2020
erikaheidi
55
13k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.2k
Transcript
バッファキャッシュ Dec 29th, 2020 Satoru Takeuchi Twitter: satoru_takeuchi, EnSatoru 1
バッファキャッシュとは • ストレージのデータを一時的にキャッシュしておくしくみ • freeコマンドで出力される”buff/cache”のうちの”buff”のほう • ページキャッシュとの違い ◦ ページキャッシュ: 通常のファイルの中身をキャッシュ
◦ バッファキャッシュ: 上記以外のメタデータをキャッシュ ▪ ブロックデバイスファイルのデータ ▪ inode、ディレクトリの中身 • Btrfsのようにinodeもページキャッシュに置かれるファイルシステムも 2
バッファキャッシュの情報 • freeの”buff/cache”: バッファキャッシュの総量+ページキャッシュの総量(*1) ◦ 通常はほとんどがページキャッシュ • sar -rのkbbuffers(KiB単位) 3
*1) カーネルのslabという領域も含む
実験A: ブロックデバイスのデータをキャッシュ 1. sync & drop_caches 2. sar -r 1
1を実行し、kbbuffersの値を記録 3. ブロックデバイスから1GB読む 4. sar - 1 1を実行し、kbbuffersの値が増えていることを確認 4
実験B: inodeのデータを書き込む 1. sync & drop_caches 2. sar -r 1
1 3. ext4ファイルシステムに一万個の空ファイルを作る 4. sar -r 1 1を実行 5
まとめ • バッファキャッシュはディスクの内容をメモリにキャッシュする • キャッシュの対象となるのは通常のファイルの内容以外のもの ◦ ブロックデバイスファイルの内容 ◦ inode, ディレクトリの内容
• 予告: ページキャッシュとバッファキャッシュ マニアクス(仮) 6