銝 擐隞蝝寧′蝣 I/O Scheduler, E( \ V9 {: ^
9 A9 A1 y5 U0 L7 v7 j5 a6 j
! r" P G* [: O" g% ^( C: hI/O Scheduler臭暻潘Wiki隤芣:
4 o) k) S7 \( J( XInput / 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'.
6 r6 C, J7 k! {7 G, ^3 C D2 G& t2 y( H
+ v8 l: x/ ~# H) u' }0 |0 h
蝪∪桃隤迎撠望航臭誑蝬曹閮剖嚗靘啗矽渡蝣摮(I/O)璅∪銝蝔株身摰撌亙瑯
3 z; c" e" n; ^: }; ^8 @. Y. [- k# s9 e' G6 Y7 r
, }. i. e* V" ? V; D5 _( g桀Linux舀游蝔埋/O Schedule璅∪嚗亦:& _$ V* F. Z! w% z. c9 Z
4 X7 X6 _% w0 ~ T9 r( H
' H" U6 d/ l7 z: N' q2 ]( j+ X
Noop Scheduler (蝪∠迂noop) -- RIAD SSD 撱箄降雿輻 noop
D J' i/ g ?) a1 Z% T- H臭誑蝞舀箸砌蝪∪Scheduler嚗銝餉冽潔鈭頛箇孵亦頠擃蝖祇剝雿啣銝哨銝鈭頠/蝖祇撌脩瑕芸楛I/O摮璈塚銝撠潛頂蝯望詨閬瘙頛撠嚗璅Scheduler瘥頛拙典典亙啣蝟餌絞銝准
8 ~6 i; Y, @! B! o; A a4 b) e) {. w" {# C1 m: D
) ~/ [6 q$ u- c+ r) H) y3 t- JCompletely Fair Queuing (蝪∠迂cfq)
$ R% S: A+ ]* m% N憿批蝢抬撠蝖祉蝟餌絞冽閬I/O隞餃嚗蝯衣詨雿摨(Queuing)嚗璅Scheduler拙冽潔砌蝙刻獢銝餉衣雿啣嚗芸2006撟12Linux Kernel 2.6.18銝渲喃伐CFQ Scheduler銝湔烊inux詨閮剔 I/O scheduler
0 r* q# p H8 ]: C) N* x5 [1 z% P, A! E0 ?" \3 j
) y/ ^2 h6 ?; s5 o! A0 Y
Anticipatory Scheduling (蝪∠迂anticipatory)
# q% L8 T+ S0 {0 E& B* e9 K- m3 \3 M曄銝摨行烊inux 2.6 Kernel 閮 I/O Scheduler 嚗婢nticipatory (/) 摮閫靘嚗憒蝚砌I/O箇橘銝亦蝟餌絞蝚砌I/O隢瘙雿嚗Anticipatory Scheduling撠Y銝閮剝閬6瘥怎"皜"()嚗皜穿臬函皜祉洵鈭I/O隢瘙航隞暻潛函嚗璅皜祇單芋撘函撣豢折脰冽摮蝟餌絞扳頛憭抒撱園莎撠文嗆臬鞈摨恍璅蝟餌絞啣嚗雿銋嚗Anticipatory Scheduling撠澆蝬脤隡箸券璅蝟餌絞銵函曄貊嗅末0 z* w0 U% i# Q) y: K2 r
; s, F2 O! V3 ~$ E/ T' S: Y2 x
% D2 A2 f8 E" E, |Deadline Scheduler (蝪∠迂deadline) -- SATA 撱箄降雿輻 deadline
6 c8 \% G! x4 U* g銝餉Scheduler撠望舫撠Anticipatory Scheduling蝻粹靘脰孵嚗摰撠蝤蝣銝剔撣賊剖啣銝函撘嚗閮銝西ˊ雿蝚血撠撱園脫雿摨嚗璅蝯撠潸摨怎頂蝯梯賣靘游摮' @0 f# s7 w& J9 h
, n, w( f$ N' a2 z3 v: M
5 f- t* K( @7 l5 U `% g4 I銝爹ed Hat Enterprise Linux 4 (2.6 Kernel) 剝Oracle10G鞈摨怨蝔埋/O Scheduler皜祈岫蝯 (鞈靘皞撅昱edhat砍豢)
7 P) _% ~, t/ Y! \9 l2 o
' h" v6 k& x# ]. S
* U |% N4 {$ H
蝪∪桃閫鈭I/O Scheduler璅∪撌桃啣嚗臭誑撠銝脣閮剖靘剝銝I/O Scheduler脰賭隤踵∴擐曉啁恣I/O Scheduler蝟餌絞瑼獢嚗瑼獢舐牢at孵靘霈:
6 r* a ]; {0 N% u: Z1 `: Q) ?5 Z
+ f' c4 u0 P& z& P. Z! S0 `. }: s c% C7 s& J
#cat /sys/block/sda/queue/scheduler8 J) @6 ], }2 Y
[noop] anticipatory deadline cfq
' Y" ^/ d; A/ b! ]9 j) {# l5 u
; j+ V9 G% H6 F7 o$ k) m/ F* ]8 Q! n& R6 U
敺銝靘嚗臭誑仿桀I/O Scheduler璅∪摸oop. (獢 [ ] )( ] W/ D) v; o( l
: W% W8 q. t/ L7 E+ C
4 N( ]6 I/ a `
仿閬脰靽格寡矽湛雿瘜拍車:
: Y6 g: A/ k3 k9 P) q( H- C" j& a! p9 f- y1 H
* L/ Z0 _3 t& N+ I
1. 格活隤踵湛唾矽游喟嚗蝬庸cho隞支湔遐/O Scheduler璅∪9 T- _1 C) j4 p
6 o& U; p# ]" ]4 S
Y: E V3 f7 _. d+ O/ N4 |#echo Deadline>/sys/block/sda/queue/scheduler
" L. a! [6 F0 ]6 S, v0 r7 r6 J
& g$ i1 W, C8 J" z- i% N! g9 m9 B
% U$ g5 U% S4 P! d% m4 ~6 L7 ?銝靘箏桀sda憿蝖祉I/O Scheduler湔寧慣eadline璅∪嚗孵典喟嚗雿圈璈敺啁頂蝯望詨暺隤I/O Scheduler璅∪
$ G: ?5 A" G- g" Y! p! t: r. ~5 M4 n4 P7 J( \" w: }( Z2 ?
$ M3 T$ r- D4 \
2. 刻蝟餌絞璈脰隤踵渡:8 R. S' b) l! Z5 F1 h2 L3 f5 k
隞乩21) _9 ]8 [9 f/ N+ Q
/etc/rc.local 批乩銵: echo anticipatory > /sys/block/sdb/queue/scheduler 函頂蝯梁GRUB璈瑼獢銝哨敺銝銵銝elevator=deadline嚗喳舀潭甈⊿璈敺賭Deadline Scheduler雿璅∪嚗憒銝靘:
6 l5 w7 \# S2 R4 p7 g* I( O
% x+ T: y5 W. y: {3 ]& Y) T
Q1 G$ y0 K" q0 }9 V( E; J- V" T蝺刻摩 /boot/grub/grub.conf4 A, Q8 K" o9 W7 `, G+ Z
; z/ `! E: M+ V# C0 ~ l2 J( R' o: t' V% b f
title Fedora Core (2.6.9-5.0.3.EL_lustre.1.4.2custom)+ ?, D6 _+ j; w) q2 D3 A
root (hd0,0)4 h- [$ s! [4 N( }5 M
kernel /vmlinuz-2.6.9-5.0.3.EL_lustre.1.4.2custom ro4 T: C; r: Y0 y0 Z/ t* y
root=/dev/VolGroup00/LogVol00 rhgb noapic quiet elevator=deadline
3 M# R. @5 T2 ^* K: O3 V) E1 n5 \7 e: l* P7 @6 v
t; f" G% o9 w, q, h
) U( E3 Q: B& k* n. G6 w6 t1 E- b" P
' S. v" j: ]- Q# [) a鈭 乩靘舐′蝣 Readahead 敹怠
4 f, a* e* {( z) K
9 `3 j0 f+ z. j$ i" J
3 ]9 M: j: \/ U; A4 u7 m0 S其遢撠望頛摰寞閫嚗蝬梁頂蝯梁蝣霈閮剖靘霈踝蝬梯矽嵇eadahead Sectors憭批靘憓脩頂蝯梁蝣霈賢榆堆撠望航矽∠銝餉桃
Z4 i( A3 F( s' ?5 _) t" X
; |9 w) L! C; T- J' e- v5 v: d! k% S6 A! s
蝬尉inux蝟餌絞隞: blockdev 靘瑼Z桀sda蝖祉Readahead Sectors憭批嚗蝭靘憒銝) j- P; c+ n+ f; ?! R9 u6 `% B
% [* |" P' l! s# A4 e5 L) @
2 w, x z+ y7 D* k0 ?+ j
#blockdev --getra /dev/sda (蝟餌絞閮剜256M)
2 A5 ^+ b0 J/ ^. S512+ b8 A; @2 N" z! \' J" b9 S' f
d- ]8 v5 C. D3 |; Y
9 k: E4 J, A' ^$ m5 @$ i, F2 x
蝬梯矽游訾蒂撣嗅兄ectors憭批嚗靘脰質矽湛蝭靘憒銝:3 u$ x. [" [. B+ Z, @7 C& T
H+ k" h0 _3 M5 [2 P% c% }' d* P# ]7 @4 p' K
#blockdev --setra 4096 /dev/sda! @ P8 h4 x8 |. F5 `
& ]4 f. Z' ]/ g+ e
4 _4 ~* P7 q/ {$ r! B#blockdev --getra /dev/sda- B1 G! s' k+ q5 ]3 S) L% }
4096
' W, Y7 i5 S' n
, m$ B& h! W+ i, b2 d: a刻蝟餌絞璈芸閮剖:& c- n/ @# v* u8 i4 g" M0 W( @# Z
/etc/rc.local 批乩銵:
, T! H- {8 H. a, \$ }2 _blockdev --setra 4096 /dev/sda! k6 _3 k% O1 P. f
1 l# q ]$ f. O5 i9 C蝬拍車蝖祉質矽∠撠寞嚗舀賢典祈賢停瘥頛撌桃蝖祇啣銋銝嚗憭憯璁典箔鈭霈賬
3 _6 `- U& Y' d, J+ }" x& E5 A" y撖虫:隞亙鈕erver敺憭撌乩,靘憒 ffmpeg, php(move_uploaded_file)銝喳之瑼獢 ,tar , mv 憭抒瑼獢,雿撟曆∩,摰典銝鈭,蝬銝餈啁隤踵,憿摰刻圾瘙- q e0 K, U" F
- ]& a: H2 H* J血,sysctl.conf隤踵銋舀撟怠拍
* z* c' q) R; c) W* ]" H( n b0 z! s0 Z6 F i3 c
# k/ ^; V8 U- ]( p( x! r8 T4 W: Y \靘皞:
3 q! K5 n4 R+ F0 k
: ^* i; b1 l0 `9 S4 D# Ohttp://itstorage.storageforum.tw ... eadahead-cache.html/ ]4 ]1 r( v( H( F" X
|
|