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
その ionice、ほんとに効いてますか?
Search
Narimichi Takamura
September 12, 2014
Technology
0
370
その ionice、ほんとに効いてますか?
2014/08/14、社内勉強会の資料です。
Narimichi Takamura
September 12, 2014
Tweet
Share
More Decks by Narimichi Takamura
See All by Narimichi Takamura
インシデントキーメトリクスによるインシデント対応の改善 / Improving Incident Response using Incident Key Metrics
nari_ex
1
9.3k
組織的なインシデント対応を目指して〜成熟度評価と改善のステップ〜 / Towards an Organized Incident Response - Maturity Assessment and Improvement Steps -
nari_ex
7
8.1k
Waroomの開発モチベーションと今後のロードマップ / Waroom development motivation and roadmap
nari_ex
1
1.5k
Engineering with Business Impact
nari_ex
2
300
How We Foster Reliability in Diversity
nari_ex
14
13k
SRE Practices in Organizations
nari_ex
16
9.4k
Hardening におけるトラブルシューティング / Troubleshooting in Hardening
nari_ex
1
340
私が Engineering Manager になるまでに経験してきたこと、大切にしてきたこと / Lecture materials for Introduction to Venture Business at UEC
nari_ex
0
240
運用技術者組織の設計と運用 / Design and operation of operational engineer organization
nari_ex
11
9.7k
Other Decks in Technology
See All in Technology
OSMnx Galleryの紹介
mopinfish
0
150
NW運用の工夫と発明
recuraki
1
790
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
2
7.2k
オープンソースのハードウェアのコンテストに参加している話
iotengineer22
0
560
コードの考古学 〜労務システムから発掘した成長の糧〜
kenta_smarthr
1
1.2k
CSSDay, Amsterdam
brucel
0
110
アプリケーションの中身が見える!Mackerel APMの全貌と展望 / Mackerel APMリリースパーティ
mackerelio
0
440
データ戦略部門 紹介資料
sansan33
PRO
1
3.1k
テストを実施する前に考えるべきテストの話 / Thinking About Testing Before You Test
nihonbuson
PRO
14
2k
エンジニアが組織に馴染むために勉強会を主催してチームの壁を越える
ohmori_yusuke
2
120
TypeScript と歩む OpenAPI の discriminator / OpenAPI discriminator with TypeScript
kaminashi
1
150
GoogleのAI Agent
shukob
0
130
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.3k
4 Signs Your Business is Dying
shpigford
183
22k
Designing Experiences People Love
moore
142
24k
Designing for humans not robots
tammielis
253
25k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
Why Our Code Smells
bkeepers
PRO
336
57k
Producing Creativity
orderedlist
PRO
346
40k
Code Reviewing Like a Champion
maltzj
523
40k
Site-Speed That Sticks
csswizardry
7
590
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Typedesign – Prime Four
hannesfritz
41
2.6k
Transcript
ͦͷ IONICE, ΄Μͱʹޮ͍ͯ·͔͢ʁ TAKAMURA Narimichi @nari_ex hbstudy-2014-08-14
what is ionice ? I/O ͷॲཧ༏ઌΛࢦఆ͢ΔLinuxίϚϯυ nice ίϚϯυͷ I/O όʔδϣϯ
nice ίϚϯυͰ I/O ༏ઌΛ੍ޚෆՄ
I/O ༏ઌΫϥε RT ( Real-time ) ࠷ߴ༏ઌ BE ( Best-Effort
) σϑΥϧτ༏ઌ Idle ࠷༏ઌ
BE: Ϋϥε༏ઌ BE ΫϥεͷΈɺΫϥε༏ઌ͕͋Δ ༏ઌ 0ʙ7 ·Ͱͷ 8ஈ֊ 0͕࠷ߴ༏ઌɺ7͕࠷༏ઌ ༏ઌΫϥεͷΛ͑ͳ͍
RT > BE (0) IDLE < BE (7)
None
How to ionice RT ΫϥεΛࢦఆ: ionice -c1 BE ΫϥεΛࢦఆ: ionice
-c2 -n <0ʙ7> IDLE ΫϥεΛࢦఆ: ionice -c3
༨ஊ: nice ίϚϯυ Ϋϥεͳ͍ ༏ઌ ( nice ) -20ʙ19
-20 ͕࠷ߴ༏ઌɺ19͕࠷༏ઌ
ෛՙΛ࠷খݶʹ͍͑ͨʂ
ionice, nice Λۦͯ͠…
# ionice -c3 nice -n19
͜ΕͰᘳͩʂʂʂ
None
ͪΐͬͱ·ͬͯ
ͦͷ IONICE, ΄Μͱʹޮ͍ͯ·͔͢ʁ
None
ionice ͕ޮ݅͘ I/O εέδϡʔϥ ReadͳͷʁWriteͳͷʁϑϥάʁ ϑΝΠϧ࡞ϑϥά Ωϟογϡͷ༗ແ
I/O Scheduler…
VFS Χʔωϧۭؒ γεςϜίʔϧ Ϣʔβۭؒ ཧ σόΠε ϑΝΠϧγεςϜ σΟεΫΩϟογϡ ൚༻ϒϩοΫ ཧ
σόΠε ϓϩηε I/Oεέδϡʔϥ σόΠε υϥΠό σόΠε υϥΠό
݅ͦͷ̍: I/O Scheduler(1) CFQ εέδϡʔϥҎ֎ແཧ Linux ඪ४ͷεέδϡʔϥ CFQ Amazon Linux
Noop ͳͷͰҙ Unbreakable Linux Deadline ͳ ͷͰҙ
σόΠεͻͱͭʹI/Oεέδϡʔϥͻͱͭ σόΠεΛ·͙ͨॲཧͷ߹ʹҙ ॲཧʹؔΘΔͯ͢ͷσόΠεΛ֬ೝͤΑ # cat /sys/block/<DEV_NAME>/queue/ scheduler ݅ͦͷ̍: I/O Scheduler(2)
݅ͦͷ̎: I/Oॲཧͷ༰(1) Write() جຊతʹޮ͔ͳ͍ O_DIRECT, O_SYNC Λϑϥάཱͯ ͯΕOK -o sync
ͰϚϯτ͞ΕͨϑΝΠϧ γεςϜͳΒOK
݅ͦͷ̎: I/Oॲཧͷ༰(2) Read() ͯ͢ʹޮ͘Θ͚Ͱͳ͍ σΟεΫΩϟογϡ͕͋Δͱμϝ σΟεΫΞΫηεͳ͍͔Βવ
·ͱΊ ionice ҎԼͷ ̎݅Λຬͨͨ࣌͠ʹͪΌΜͱಈ͘ I/O Scheduler ͕ CFQ ಛఆͷI/Oॲཧ Ωϟογϡ͞Ε͍ͯͳ͍ϑΝΠϧͷRead
ಛघϑϥάͷཱͬͨ Write
͍͞͝ʹ man ioprio_set Λಡ͏ ϑΝΠϧ࡞ϑϥάͷࡉ͔͍͜ͱ·ͨࠓ O_SYNC, O_DSYNC, O_FSYNC… ionice -p
<PID> Λ͏ͱɺىಈதͷϓϩη εͷI/O༏ઌมߋͰ͖ΔΑ