銝 擐隞蝝寧′蝣 I/O Scheduler
8 _/ v! R3 q. Z/ U- s* ]1 Q& u$ @5 b- B2 e6 e) H5 R' B
5 g' r3 x i) L% A
I/O Scheduler臭暻潘Wiki隤芣:% [( C8 R9 g F6 C
Input / Output Scheduling or I/O Scheduling is a term used to describe the method computer operating systems decide the order that block I/O operations will be submitted to storage volumes. I/O Scheduling is sometimes called 'disk scheduling'.
4 [; D' M* \; P& B! n( K7 M: W! U6 y& |
/ K1 J8 P8 }1 e7 A) v蝪∪桃隤迎撠望航臭誑蝬曹閮剖嚗靘啗矽渡蝣摮(I/O)璅∪銝蝔株身摰撌亙瑯
0 C: j% X& q+ G# F2 Z: h, `' r4 E/ d: t; n
+ y2 r# S* I }+ ^- j7 {0 |/ r. ]
桀Linux舀游蝔埋/O Schedule璅∪嚗亦:
7 C" t4 h- q4 W& W5 }' _7 S
; t0 K: Y, ]) Q0 I0 |/ n6 n% c& H# x7 ^
Noop Scheduler (蝪∠迂noop) -- RIAD SSD 撱箄降雿輻 noop
( I0 z7 t0 m" _! v5 I+ d臭誑蝞舀箸砌蝪∪Scheduler嚗銝餉冽潔鈭頛箇孵亦頠擃蝖祇剝雿啣銝哨銝鈭頠/蝖祇撌脩瑕芸楛I/O摮璈塚銝撠潛頂蝯望詨閬瘙頛撠嚗璅Scheduler瘥頛拙典典亙啣蝟餌絞銝准) X9 _' y8 `: \, r( j! R
* j5 ] E7 l$ k2 Q; G
9 [. a' ~8 U8 L* D' g, SCompletely Fair Queuing (蝪∠迂cfq)- z& x; n4 N) }& r+ x, R( S* f
憿批蝢抬撠蝖祉蝟餌絞冽閬I/O隞餃嚗蝯衣詨雿摨(Queuing)嚗璅Scheduler拙冽潔砌蝙刻獢銝餉衣雿啣嚗芸2006撟12Linux Kernel 2.6.18銝渲喃伐CFQ Scheduler銝湔烊inux詨閮剔 I/O scheduler0 ~2 L1 l5 S) L) _
" N7 s: `+ @+ `# i* V$ ]
2 ?; }& r) ?0 v1 sAnticipatory Scheduling (蝪∠迂anticipatory); E6 ]) Z& y, |% e0 B l: V
曄銝摨行烊inux 2.6 Kernel 閮 I/O Scheduler 嚗婢nticipatory (/) 摮閫靘嚗憒蝚砌I/O箇橘銝亦蝟餌絞蝚砌I/O隢瘙雿嚗Anticipatory Scheduling撠Y銝閮剝閬6瘥怎"皜"()嚗皜穿臬函皜祉洵鈭I/O隢瘙航隞暻潛函嚗璅皜祇單芋撘函撣豢折脰冽摮蝟餌絞扳頛憭抒撱園莎撠文嗆臬鞈摨恍璅蝟餌絞啣嚗雿銋嚗Anticipatory Scheduling撠澆蝬脤隡箸券璅蝟餌絞銵函曄貊嗅末
7 A% b9 q9 w4 ?4 I' Z$ _% f' `
0 |! k! _$ r$ M7 UDeadline Scheduler (蝪∠迂deadline) -- SATA 撱箄降雿輻 deadline
3 Y0 q: W; Z- i7 i5 c, s! p銝餉Scheduler撠望舫撠Anticipatory Scheduling蝻粹靘脰孵嚗摰撠蝤蝣銝剔撣賊剖啣銝函撘嚗閮銝西ˊ雿蝚血撠撱園脫雿摨嚗璅蝯撠潸摨怎頂蝯梯賣靘游摮
* T1 n( b) X; o3 \! s# W" v
$ F: p# R# |+ ^" `* E. `. f# }4 g
& u7 L7 D( }4 W/ {; j銝爹ed Hat Enterprise Linux 4 (2.6 Kernel) 剝Oracle10G鞈摨怨蝔埋/O Scheduler皜祈岫蝯 (鞈靘皞撅昱edhat砍豢)& I0 F* T7 Q I9 C: l
# t! |. e0 g' S9 G" x4 M6 W
* z+ H! C e' D- K蝪∪桃閫鈭I/O Scheduler璅∪撌桃啣嚗臭誑撠銝脣閮剖靘剝銝I/O Scheduler脰賭隤踵∴擐曉啁恣I/O Scheduler蝟餌絞瑼獢嚗瑼獢舐牢at孵靘霈:; e- H0 Z I2 }1 S; B
1 |5 d9 w' N; l# N1 G/ S7 h$ q
% ^3 j4 a* h+ ~( u# \/ N% }#cat /sys/block/sda/queue/scheduler
0 M. E% O9 Y8 u) ?[noop] anticipatory deadline cfq3 q0 ~. T4 F0 v- `5 q2 G" c
* [0 @+ F' S2 `# `
( Q% V" O* k+ S+ \敺銝靘嚗臭誑仿桀I/O Scheduler璅∪摸oop. (獢 [ ] )
S) m9 S# [5 a' N
7 K1 {& m- x6 Y @ x* y2 J: H, @, U9 D, v* }8 G# I. U
仿閬脰靽格寡矽湛雿瘜拍車:
2 |( L7 b* A4 O' Z1 E
7 l; G2 _+ b! S* {9 M4 B1 V0 E' X1 F& t" z' p
1. 格活隤踵湛唾矽游喟嚗蝬庸cho隞支湔遐/O Scheduler璅∪* u4 D* c, ?; ]) i9 D X0 w$ L
, N8 G! z# o/ r
' v- o! e2 q1 E0 \#echo Deadline>/sys/block/sda/queue/scheduler- W$ c: u2 G% ]' S/ a- e& L
% F& E( V; S, G
4 Q% t; J/ E+ g4 [, W銝靘箏桀sda憿蝖祉I/O Scheduler湔寧慣eadline璅∪嚗孵典喟嚗雿圈璈敺啁頂蝯望詨暺隤I/O Scheduler璅∪
* J% `/ n: f# c: N0 a2 J" N7 J1 j/ t. j4 z$ |& n
: ]2 i! A; i4 F. S. m; Z# u2. 刻蝟餌絞璈脰隤踵渡:0 {5 b) @; n* Y6 @
隞乩21- v U) } W; T$ m$ G
/etc/rc.local 批乩銵: echo anticipatory > /sys/block/sdb/queue/scheduler 函頂蝯梁GRUB璈瑼獢銝哨敺銝銵銝elevator=deadline嚗喳舀潭甈⊿璈敺賭Deadline Scheduler雿璅∪嚗憒銝靘:! e: \5 w( x3 D- O+ u, d
; e2 V! t) c3 @- z8 f
) e K. L& n2 d/ _5 h% C9 C+ @$ k H
蝺刻摩 /boot/grub/grub.conf6 ?0 z1 ]7 J# _
. S8 p7 D/ ]5 W
, P( R$ H. [/ {+ o; M% atitle Fedora Core (2.6.9-5.0.3.EL_lustre.1.4.2custom)' t# P9 o, p! g' U( x$ C" N7 [
root (hd0,0)
t8 b& e* {1 c& }; e' {. {kernel /vmlinuz-2.6.9-5.0.3.EL_lustre.1.4.2custom ro: z- k" \/ q0 ^# |5 f' w. s4 L
root=/dev/VolGroup00/LogVol00 rhgb noapic quiet elevator=deadline
8 q) V( i$ V; \5 C! R/ h9 t$ A6 b: D: Q
; F [. H4 ?1 B1 E9 h7 }* t3 ?% l8 @: k- x% j
" w* J7 {- W( j ?# ^+ z鈭 乩靘舐′蝣 Readahead 敹怠
6 Y. c; a: w6 V; w; ^7 m
' b. i; Y& q# n+ A: J( M* n: @* `8 z! D
其遢撠望頛摰寞閫嚗蝬梁頂蝯梁蝣霈閮剖靘霈踝蝬梯矽嵇eadahead Sectors憭批靘憓脩頂蝯梁蝣霈賢榆堆撠望航矽∠銝餉桃
$ a2 P* \5 P. F, w$ a& L6 z. I
0 r& K" r3 l: f: X$ ]
# J/ F8 X0 Q8 [* O5 U蝬尉inux蝟餌絞隞: blockdev 靘瑼Z桀sda蝖祉Readahead Sectors憭批嚗蝭靘憒銝3 V/ F9 C x" W
1 D1 _; U {' e' j! f4 y
3 W- U+ o/ z+ I0 U# ?! f" ]( _
#blockdev --getra /dev/sda (蝟餌絞閮剜256M)
; r! L- ?# v% I7 }! ?1 o6 c1 G512' \/ `$ [3 I1 L& }% y
@3 l" |+ v0 C1 l
1 X4 H/ c; U8 m) z
蝬梯矽游訾蒂撣嗅兄ectors憭批嚗靘脰質矽湛蝭靘憒銝:
% }3 J6 q o7 a/ r0 I# s" o4 Y, r" S# @8 w j- ^6 g$ |3 U
* ]( l X( _8 ~
#blockdev --setra 4096 /dev/sda
0 K/ w. \' _8 n0 I1 C6 Y V3 p' Z& b6 u* y
2 H7 d. g! G* G2 b% |( D2 Z) F* A" Y6 _5 j! Y7 P9 R i/ U! b
#blockdev --getra /dev/sda
) L3 H: e5 @2 x5 k8 Z40964 G9 C* Q/ l! e( P0 N# h0 Y/ v
$ U9 E# K! k3 J3 q刻蝟餌絞璈芸閮剖:
, s# l( t$ Z5 J3 m( } /etc/rc.local 批乩銵:
! [$ Q. C9 A1 i! Eblockdev --setra 4096 /dev/sda) u! o# Y' {: q, q m$ h! J
' k% P4 ]! N r, e
蝬拍車蝖祉質矽∠撠寞嚗舀賢典祈賢停瘥頛撌桃蝖祇啣銋銝嚗憭憯璁典箔鈭霈賬
& v$ z! t0 U0 K _撖虫:隞亙鈕erver敺憭撌乩,靘憒 ffmpeg, php(move_uploaded_file)銝喳之瑼獢 ,tar , mv 憭抒瑼獢,雿撟曆∩,摰典銝鈭,蝬銝餈啁隤踵,憿摰刻圾瘙
% ]. \* e; x; n1 i4 \* E. A C4 W* A8 r" |' d7 o5 Q
血,sysctl.conf隤踵銋舀撟怠拍2 ~. s" H: y8 a7 ?) ^% e
# G) }6 M9 }0 G5 ~* s* A' a
+ E5 u" n9 W8 p) ]+ o# z
靘皞:4 h6 t8 I0 {& F
7 ^. n; P. H4 S7 D, Ehttp://itstorage.storageforum.tw ... eadahead-cache.html
+ H' h0 @3 U4 t: Q p6 F |
|