銝 擐隞蝝寧′蝣 I/O Scheduler
8 K6 G# j. O" ?, Q5 R
) `- a. h! v {& r. t) g; }
8 u; R, j9 t% P" r. gI/O Scheduler臭暻潘Wiki隤芣:6 A4 G" `) f5 X5 Z$ D. J8 g& }
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'.
c* X/ f0 V+ q Y5 B2 }; W
( K% s- T- v" e3 j) s' x _7 g& b7 g# V# Q6 \$ c
蝪∪桃隤迎撠望航臭誑蝬曹閮剖嚗靘啗矽渡蝣摮(I/O)璅∪銝蝔株身摰撌亙瑯+ d! r* D% `8 Z& L; ~% v
" P! ]2 n) |# n& D6 V, Q7 a" @: g
9 p0 d8 s1 a' H) Z6 i8 y7 s2 ^) w8 b# x桀Linux舀游蝔埋/O Schedule璅∪嚗亦:( U" H- P& v1 b2 m, u% U* V3 r6 S
( R: V* h- r7 d9 a' J# h: `% l1 b
% D8 _( e& n5 l* L
Noop Scheduler (蝪∠迂noop) -- RIAD SSD 撱箄降雿輻 noop
% Y+ G' C9 M+ z; |臭誑蝞舀箸砌蝪∪Scheduler嚗銝餉冽潔鈭頛箇孵亦頠擃蝖祇剝雿啣銝哨銝鈭頠/蝖祇撌脩瑕芸楛I/O摮璈塚銝撠潛頂蝯望詨閬瘙頛撠嚗璅Scheduler瘥頛拙典典亙啣蝟餌絞銝准1 I0 c6 H6 a( B/ _
: i. w: l# S6 l1 v& F; D! ~5 p8 W1 @% W
Completely Fair Queuing (蝪∠迂cfq)1 [3 ~4 u% l7 C! y1 G0 }. ^' H
憿批蝢抬撠蝖祉蝟餌絞冽閬I/O隞餃嚗蝯衣詨雿摨(Queuing)嚗璅Scheduler拙冽潔砌蝙刻獢銝餉衣雿啣嚗芸2006撟12Linux Kernel 2.6.18銝渲喃伐CFQ Scheduler銝湔烊inux詨閮剔 I/O scheduler8 b1 D- |5 l( `' u6 J, g/ d- B
) I7 j0 d5 L. s: s7 D4 k9 c. m
2 q4 A0 ?0 [6 X$ N3 G
Anticipatory Scheduling (蝪∠迂anticipatory)9 f5 e2 |' b: u; g! V) I. y8 R' O( i
曄銝摨行烊inux 2.6 Kernel 閮 I/O Scheduler 嚗婢nticipatory (/) 摮閫靘嚗憒蝚砌I/O箇橘銝亦蝟餌絞蝚砌I/O隢瘙雿嚗Anticipatory Scheduling撠Y銝閮剝閬6瘥怎"皜"()嚗皜穿臬函皜祉洵鈭I/O隢瘙航隞暻潛函嚗璅皜祇單芋撘函撣豢折脰冽摮蝟餌絞扳頛憭抒撱園莎撠文嗆臬鞈摨恍璅蝟餌絞啣嚗雿銋嚗Anticipatory Scheduling撠澆蝬脤隡箸券璅蝟餌絞銵函曄貊嗅末
* F& h* d+ a% i" {
) m# Y! d4 e' D4 o4 q+ j/ @3 B
( B2 d# X; o* m" R% rDeadline Scheduler (蝪∠迂deadline) -- SATA 撱箄降雿輻 deadline
0 N1 H) i) o. M銝餉Scheduler撠望舫撠Anticipatory Scheduling蝻粹靘脰孵嚗摰撠蝤蝣銝剔撣賊剖啣銝函撘嚗閮銝西ˊ雿蝚血撠撱園脫雿摨嚗璅蝯撠潸摨怎頂蝯梯賣靘游摮
! L1 P' j: o5 x1 T8 S
8 ~/ Y, d* t$ |5 b/ |) e
, P8 \+ ^' S- N銝爹ed Hat Enterprise Linux 4 (2.6 Kernel) 剝Oracle10G鞈摨怨蝔埋/O Scheduler皜祈岫蝯 (鞈靘皞撅昱edhat砍豢)
/ a; l2 F3 o4 p1 @
/ H A( s3 a/ e/ a# o9 h3 K
3 Z* v2 g2 U3 k! j7 O$ z% a蝪∪桃閫鈭I/O Scheduler璅∪撌桃啣嚗臭誑撠銝脣閮剖靘剝銝I/O Scheduler脰賭隤踵∴擐曉啁恣I/O Scheduler蝟餌絞瑼獢嚗瑼獢舐牢at孵靘霈:
, |( F* V P7 w4 Y9 [" @" d
) M, Z' h6 Y1 Y- A0 d: r; e+ x/ ^( p7 K, U( D
#cat /sys/block/sda/queue/scheduler
; }5 u' o7 g" e[noop] anticipatory deadline cfq
+ {- y- [4 W2 k3 p) { L) u% ?3 x" f, r
" \6 P2 ]0 N, m+ D, K' ]
敺銝靘嚗臭誑仿桀I/O Scheduler璅∪摸oop. (獢 [ ] )$ _' U6 |' y/ ?/ S& ^8 y
1 B L; a5 E/ Q1 [8 z% v& a/ V5 y V! K8 i5 g c* h1 G- g+ B! Z9 Y
仿閬脰靽格寡矽湛雿瘜拍車:
9 I% t2 \& b6 C4 B1 w6 A9 a2 k% M4 L
$ d4 K$ Q7 q% ^. j/ V
1. 格活隤踵湛唾矽游喟嚗蝬庸cho隞支湔遐/O Scheduler璅∪
/ W' x3 ^7 A( b2 Z4 H0 {( @- L
9 g, F% r! ]0 c. Z3 p8 @/ ~7 f2 b5 g1 O" ]9 r: m. o4 p
#echo Deadline>/sys/block/sda/queue/scheduler/ b6 L3 t N4 x
9 Q. u" i i' b
' r' E( R9 A Z+ j& |9 g6 H7 K
銝靘箏桀sda憿蝖祉I/O Scheduler湔寧慣eadline璅∪嚗孵典喟嚗雿圈璈敺啁頂蝯望詨暺隤I/O Scheduler璅∪# o1 _ ]3 g4 I4 g: `
5 u0 x6 q& x9 `; c% w$ l9 n' v
* h' L* x* u8 ^' i2. 刻蝟餌絞璈脰隤踵渡:$ w* W5 D$ G( [9 |
隞乩21
8 B, Y5 l: j8 y; N4 _+ V& L /etc/rc.local 批乩銵: echo anticipatory > /sys/block/sdb/queue/scheduler 函頂蝯梁GRUB璈瑼獢銝哨敺銝銵銝elevator=deadline嚗喳舀潭甈⊿璈敺賭Deadline Scheduler雿璅∪嚗憒銝靘:6 }7 j. Y$ j" X
2 z. }0 Q6 t" U5 P Q% {: r: l+ f
) {# f ]& h/ b6 j: S蝺刻摩 /boot/grub/grub.conf
0 X( t, Y9 z+ m0 Z% T: O
7 I% c4 o- F: \7 n/ n* f8 G4 p& e0 X( k( V9 E: ?
title Fedora Core (2.6.9-5.0.3.EL_lustre.1.4.2custom)
9 W- L/ }9 a0 f0 |! u8 }root (hd0,0)
8 A3 j: }+ { t) A+ _! _! F- w* Tkernel /vmlinuz-2.6.9-5.0.3.EL_lustre.1.4.2custom ro
' _% q- l8 {* E( \7 o9 ^4 B kroot=/dev/VolGroup00/LogVol00 rhgb noapic quiet elevator=deadline. R9 y" x* M& W2 x% f4 w. x
+ V& H7 o2 ^) v K* w
5 r, I. r3 L. s7 t9 ?. M4 g. r- ~) i5 h' G: \1 b0 w5 ~3 z
' X( ^/ G3 r# T* h( n鈭 乩靘舐′蝣 Readahead 敹怠* y$ [8 I9 U6 I
. K0 x. Y" ~. L) E4 u+ Y; S
0 Y& [7 x1 h+ ?其遢撠望頛摰寞閫嚗蝬梁頂蝯梁蝣霈閮剖靘霈踝蝬梯矽嵇eadahead Sectors憭批靘憓脩頂蝯梁蝣霈賢榆堆撠望航矽∠銝餉桃
$ V$ K! w- N- y6 H; j0 p A$ x+ S c& l0 i: B5 q) h, {! e
% L& n C/ ^ p- K" A: y
蝬尉inux蝟餌絞隞: blockdev 靘瑼Z桀sda蝖祉Readahead Sectors憭批嚗蝭靘憒銝
& a' k# {9 g' W5 w8 H' i" I6 d; U1 A: o4 \7 N( y5 x) ]/ z
$ q7 ~1 B# `, Z/ I5 G) N
#blockdev --getra /dev/sda (蝟餌絞閮剜256M)
: j$ t- _ \; M$ p2 a2 y' J* s512
! P' U5 q: a; G" G h& _
6 V. ]1 E& ^. N- U, `6 ]! [% c( T
' e3 [$ x1 J2 q0 B# r9 W- D蝬梯矽游訾蒂撣嗅兄ectors憭批嚗靘脰質矽湛蝭靘憒銝:
# A$ Z; t! f ]( A2 u! I H9 e5 W! v6 x8 j" [
% r! y- i7 N! E
#blockdev --setra 4096 /dev/sda9 ^1 L. I$ k9 \- J9 q, v
: R) j# W6 o2 E' Z
( J9 ]3 O( G! u4 z#blockdev --getra /dev/sda; `8 w# i- ?: V2 f( F7 ~5 O3 @
4096- u; T0 y [" K) n0 l+ S F4 b9 x
0 M6 U5 L1 _5 V. y7 w9 R
刻蝟餌絞璈芸閮剖:
: m% K, ~9 b3 Y2 B/ R /etc/rc.local 批乩銵:+ b/ p6 Z% M0 q5 c
blockdev --setra 4096 /dev/sda% W$ y; G1 x T# R
& ^' D. I* |. f& `( O0 ~7 Z6 j
蝬拍車蝖祉質矽∠撠寞嚗舀賢典祈賢停瘥頛撌桃蝖祇啣銋銝嚗憭憯璁典箔鈭霈賬
- N d( |# J$ f5 Y撖虫:隞亙鈕erver敺憭撌乩,靘憒 ffmpeg, php(move_uploaded_file)銝喳之瑼獢 ,tar , mv 憭抒瑼獢,雿撟曆∩,摰典銝鈭,蝬銝餈啁隤踵,憿摰刻圾瘙4 o0 Y& }% o8 l8 O) R) p
; F+ R3 N$ S9 i$ i0 Z
血,sysctl.conf隤踵銋舀撟怠拍* V( }1 f3 n& @
# u8 J3 x5 p6 |) \5 [( z+ {; Z
/ d* R; V( { H' Z/ p" i靘皞:9 ]- M3 T7 R, v* m7 c
* N& ^" j' P) t) [2 v
http://itstorage.storageforum.tw ... eadahead-cache.html5 x0 s! T7 a! H6 A9 {
|
|