銝 擐隞蝝寧′蝣 I/O Scheduler
" ^: [( u8 H& l! t7 u
( b) K9 n& Q- a7 O$ }
' y. j3 a& C! ]. ^I/O Scheduler臭暻潘Wiki隤芣:
2 n5 U$ e: W) j' ]0 bInput / 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'.
3 z# K8 }- r; m% l, Z. f3 S2 g0 R5 q3 z0 C- V8 b* ]; K
) U& ^' M' I* {: [/ m
蝪∪桃隤迎撠望航臭誑蝬曹閮剖嚗靘啗矽渡蝣摮(I/O)璅∪銝蝔株身摰撌亙瑯
3 O$ T+ w) h; T9 b! s3 m4 y! w
% F' `. o5 \- t. }8 H& H& D" s: M
% z( I0 U8 d" \6 c# Q, U桀Linux舀游蝔埋/O Schedule璅∪嚗亦:
1 |7 h8 y. ?+ t/ G z, {: u& C3 ]% m" O
% |5 {6 F& P9 x9 f! s7 J- h$ t
Noop Scheduler (蝪∠迂noop) -- RIAD SSD 撱箄降雿輻 noop4 M7 X7 a( Z8 u/ z7 ~" N
臭誑蝞舀箸砌蝪∪Scheduler嚗銝餉冽潔鈭頛箇孵亦頠擃蝖祇剝雿啣銝哨銝鈭頠/蝖祇撌脩瑕芸楛I/O摮璈塚銝撠潛頂蝯望詨閬瘙頛撠嚗璅Scheduler瘥頛拙典典亙啣蝟餌絞銝准
8 k) i2 T$ h4 h( M% [+ q3 b7 _9 J' v
9 ]5 c8 X7 V& }0 m. f n4 ` }7 z, A4 F* k
Completely Fair Queuing (蝪∠迂cfq): [ ?+ g% m5 L% ]/ `" b
憿批蝢抬撠蝖祉蝟餌絞冽閬I/O隞餃嚗蝯衣詨雿摨(Queuing)嚗璅Scheduler拙冽潔砌蝙刻獢銝餉衣雿啣嚗芸2006撟12Linux Kernel 2.6.18銝渲喃伐CFQ Scheduler銝湔烊inux詨閮剔 I/O scheduler
9 H, T$ q5 s: }/ ^
4 \- l, o) w% O8 c0 b$ D8 Y! d* P4 e2 R! O0 S' v; m6 e; Q
Anticipatory Scheduling (蝪∠迂anticipatory)' m" I) ?/ O b% t
曄銝摨行烊inux 2.6 Kernel 閮 I/O Scheduler 嚗婢nticipatory (/) 摮閫靘嚗憒蝚砌I/O箇橘銝亦蝟餌絞蝚砌I/O隢瘙雿嚗Anticipatory Scheduling撠Y銝閮剝閬6瘥怎"皜"()嚗皜穿臬函皜祉洵鈭I/O隢瘙航隞暻潛函嚗璅皜祇單芋撘函撣豢折脰冽摮蝟餌絞扳頛憭抒撱園莎撠文嗆臬鞈摨恍璅蝟餌絞啣嚗雿銋嚗Anticipatory Scheduling撠澆蝬脤隡箸券璅蝟餌絞銵函曄貊嗅末
- q$ N* s. S5 D1 p6 \; B9 J- y9 I3 X* M
& x3 k* p1 a# Y2 ]
Deadline Scheduler (蝪∠迂deadline) -- SATA 撱箄降雿輻 deadline1 s( [9 @ f5 P3 W, K% K) q
銝餉Scheduler撠望舫撠Anticipatory Scheduling蝻粹靘脰孵嚗摰撠蝤蝣銝剔撣賊剖啣銝函撘嚗閮銝西ˊ雿蝚血撠撱園脫雿摨嚗璅蝯撠潸摨怎頂蝯梯賣靘游摮* l" A T8 E( \6 u& ^& H: d
# W& c1 @5 a2 K8 M5 D# L R
/ c, q4 f& m7 K2 B8 V& k; i, P% J a銝爹ed Hat Enterprise Linux 4 (2.6 Kernel) 剝Oracle10G鞈摨怨蝔埋/O Scheduler皜祈岫蝯 (鞈靘皞撅昱edhat砍豢)) _: K) U% k" F) P- x: c c
# d3 t* E f* d$ \+ b2 m& }
( _6 M2 I4 m) I0 B$ O蝪∪桃閫鈭I/O Scheduler璅∪撌桃啣嚗臭誑撠銝脣閮剖靘剝銝I/O Scheduler脰賭隤踵∴擐曉啁恣I/O Scheduler蝟餌絞瑼獢嚗瑼獢舐牢at孵靘霈:
3 L C8 Q# P0 v/ x
$ {( K& s0 X, E+ J+ n* t' C* C9 w- ~# L5 u( X! H
#cat /sys/block/sda/queue/scheduler" E* f) n/ |( [
[noop] anticipatory deadline cfq
6 Y) R( V t e: Q2 Q2 I0 O. ^( x, \, H3 b/ z# {- a5 R/ z7 F
% @/ m+ ~& o2 A u" ?+ b敺銝靘嚗臭誑仿桀I/O Scheduler璅∪摸oop. (獢 [ ] )
5 B& }# i* v1 t
6 A6 e8 ~! f4 p: ]) G
5 S" z6 E- t* _: B# p仿閬脰靽格寡矽湛雿瘜拍車:
' q1 f1 ~: f1 p. d* X5 e& u+ C0 ~( Y8 @0 g: ?. m* o1 |/ c
# K9 O. @$ _5 x5 j9 t s: h* e2 S0 P1. 格活隤踵湛唾矽游喟嚗蝬庸cho隞支湔遐/O Scheduler璅∪
2 k* }( e6 m1 H- Z* V" D% V3 j4 D) M7 f
4 z7 K' X( o# D#echo Deadline>/sys/block/sda/queue/scheduler
1 {! S/ x& w9 E& Z, |5 t
3 Q% J% a2 k4 d0 V4 v- b3 x, m
" z# X1 e: b) ~! S5 L7 Y銝靘箏桀sda憿蝖祉I/O Scheduler湔寧慣eadline璅∪嚗孵典喟嚗雿圈璈敺啁頂蝯望詨暺隤I/O Scheduler璅∪( j+ L# }& M! V( g1 T( K
0 e W# e7 I- A* B( P* L8 t: A6 Y4 Y4 u
2. 刻蝟餌絞璈脰隤踵渡:, {/ ~1 v: Q* m$ y
隞乩210 y/ y8 C, a! [& c$ o. K' l& g( k7 A
/etc/rc.local 批乩銵: echo anticipatory > /sys/block/sdb/queue/scheduler 函頂蝯梁GRUB璈瑼獢銝哨敺銝銵銝elevator=deadline嚗喳舀潭甈⊿璈敺賭Deadline Scheduler雿璅∪嚗憒銝靘:
4 w7 Y3 R" o3 W1 g& c( @
* f/ y3 V( r1 Z- h9 ^/ Z
6 g& [* w( x) a蝺刻摩 /boot/grub/grub.conf
$ B3 `! b* J8 r' r( |. }2 z6 ~* @+ M* G* V! Y! X8 g5 k
4 J1 X! G( \9 m$ i3 Z9 Q) l
title Fedora Core (2.6.9-5.0.3.EL_lustre.1.4.2custom)7 N, V1 d4 Z( a! _
root (hd0,0)' t2 A5 {: x) }* |
kernel /vmlinuz-2.6.9-5.0.3.EL_lustre.1.4.2custom ro. u! C1 B$ H6 O) ~" K2 y, I
root=/dev/VolGroup00/LogVol00 rhgb noapic quiet elevator=deadline
O: n+ R7 m+ u2 ?% J, O. u( p( u, w& ~9 e! F# m& A0 j6 _9 q3 S) r
) f6 n4 z4 g" I! O9 \
; Y3 u) S# e6 p" C5 w/ W! K% j) O6 J$ m
6 G" M( c0 o, Q鈭 乩靘舐′蝣 Readahead 敹怠
- {# R1 B a% T, ~4 `* u# c/ c/ l: m& w- Z$ a
6 _7 T+ b! m1 f其遢撠望頛摰寞閫嚗蝬梁頂蝯梁蝣霈閮剖靘霈踝蝬梯矽嵇eadahead Sectors憭批靘憓脩頂蝯梁蝣霈賢榆堆撠望航矽∠銝餉桃
& t* @) [ i( I: h( Z! I' F. e: V8 Z
4 C- \/ y6 ]' ^9 k# P. W蝬尉inux蝟餌絞隞: blockdev 靘瑼Z桀sda蝖祉Readahead Sectors憭批嚗蝭靘憒銝9 I# L2 o/ V, v k, }
8 U9 \' q9 b) D- |$ |5 u
8 p) C9 `1 `; C2 U }#blockdev --getra /dev/sda (蝟餌絞閮剜256M). L6 J; R/ v' B& z2 l
512" H, _" B2 g. q2 W: w
7 O/ _. R. k: x; u
0 @- R, I2 I4 U1 a1 {蝬梯矽游訾蒂撣嗅兄ectors憭批嚗靘脰質矽湛蝭靘憒銝:
( U- f7 n2 s2 T7 ^9 ?+ Q3 J" H5 R5 N1 o
! R! g H% |; I0 ?
#blockdev --setra 4096 /dev/sda
- c7 `: C0 ?& f N- C8 i8 G: O3 U
6 L6 a" _2 f* b3 n! u) [* f+ p+ j4 a6 X
#blockdev --getra /dev/sda
% _( p0 m& J+ n0 w4096+ Y6 y: y6 ^3 q
% B* L: w0 E' G. t- r# |7 D' u: }8 c
刻蝟餌絞璈芸閮剖:, e ~7 d" \8 y% Q
/etc/rc.local 批乩銵: t, o; a5 V( b; }) {4 ]
blockdev --setra 4096 /dev/sda7 F- I, x" V D% Y
& Z0 j( n, J0 t+ F" ^! L" h
蝬拍車蝖祉質矽∠撠寞嚗舀賢典祈賢停瘥頛撌桃蝖祇啣銋銝嚗憭憯璁典箔鈭霈賬
8 W! P1 m7 F9 {+ P撖虫:隞亙鈕erver敺憭撌乩,靘憒 ffmpeg, php(move_uploaded_file)銝喳之瑼獢 ,tar , mv 憭抒瑼獢,雿撟曆∩,摰典銝鈭,蝬銝餈啁隤踵,憿摰刻圾瘙! n3 o6 d" |, f
+ X" @* |1 H! v- e, x
血,sysctl.conf隤踵銋舀撟怠拍* v6 x' T0 E/ e! { L5 r7 N, w+ ?
9 |9 T7 K. r# a, B3 f8 v
& a5 d/ Z8 R7 E# `" [靘皞:8 h' P1 v5 w+ Q E
" o, n2 f( s9 O1 Hhttp://itstorage.storageforum.tw ... eadahead-cache.html) a5 c8 b. `$ B! P5 t, A! x
|
|