銝 擐隞蝝寧′蝣 I/O Scheduler
, i* S% Z$ K- v/ M
2 a0 J$ U2 o. a# E/ R
3 b8 L* ~3 b+ Q- \5 [' _I/O Scheduler臭暻潘Wiki隤芣:
7 E! X _, H3 p' ?$ UInput / 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'./ O8 v: p8 c* S. l2 W7 G0 b
! m5 Q. z' P9 ~( z+ ?; L* X
0 _6 `- U3 w) _4 n! C蝪∪桃隤迎撠望航臭誑蝬曹閮剖嚗靘啗矽渡蝣摮(I/O)璅∪銝蝔株身摰撌亙瑯
" [8 H$ ^3 Y* y# L0 u8 m
/ B7 R! I6 ?) Q: f' C
6 H/ W6 }6 o" ]7 ]$ I桀Linux舀游蝔埋/O Schedule璅∪嚗亦:
: P2 t# @5 G, Q8 |- V' I. Q* b. @9 ]4 K4 M9 D/ S1 \7 V9 }2 C3 o
/ E$ u! _3 z4 J2 e( z2 Y5 Q
Noop Scheduler (蝪∠迂noop) -- RIAD SSD 撱箄降雿輻 noop
# w8 y+ `- ?/ s7 \- X2 |6 }' o臭誑蝞舀箸砌蝪∪Scheduler嚗銝餉冽潔鈭頛箇孵亦頠擃蝖祇剝雿啣銝哨銝鈭頠/蝖祇撌脩瑕芸楛I/O摮璈塚銝撠潛頂蝯望詨閬瘙頛撠嚗璅Scheduler瘥頛拙典典亙啣蝟餌絞銝准
3 @' }) t4 {# g; U
% w& B2 x# X$ _/ W# P( h" ^, C& `2 b8 H6 {" N
Completely Fair Queuing (蝪∠迂cfq)
+ d+ H3 H+ E# r5 x憿批蝢抬撠蝖祉蝟餌絞冽閬I/O隞餃嚗蝯衣詨雿摨(Queuing)嚗璅Scheduler拙冽潔砌蝙刻獢銝餉衣雿啣嚗芸2006撟12Linux Kernel 2.6.18銝渲喃伐CFQ Scheduler銝湔烊inux詨閮剔 I/O scheduler; [6 m" r; l1 P1 x8 f6 W
2 H/ o# a( }5 `3 z, A; W9 T
: [: S' J/ I: qAnticipatory Scheduling (蝪∠迂anticipatory)+ X$ N: K, ~6 e9 s
曄銝摨行烊inux 2.6 Kernel 閮 I/O Scheduler 嚗婢nticipatory (/) 摮閫靘嚗憒蝚砌I/O箇橘銝亦蝟餌絞蝚砌I/O隢瘙雿嚗Anticipatory Scheduling撠Y銝閮剝閬6瘥怎"皜"()嚗皜穿臬函皜祉洵鈭I/O隢瘙航隞暻潛函嚗璅皜祇單芋撘函撣豢折脰冽摮蝟餌絞扳頛憭抒撱園莎撠文嗆臬鞈摨恍璅蝟餌絞啣嚗雿銋嚗Anticipatory Scheduling撠澆蝬脤隡箸券璅蝟餌絞銵函曄貊嗅末
4 c; j8 W5 s& n5 e4 s+ Y0 A6 k
( c9 j4 M8 l- w9 A7 | n4 P: w. D0 f5 E# t+ k4 v
Deadline Scheduler (蝪∠迂deadline) -- SATA 撱箄降雿輻 deadline
$ y0 ?+ l! r; i6 N6 _銝餉Scheduler撠望舫撠Anticipatory Scheduling蝻粹靘脰孵嚗摰撠蝤蝣銝剔撣賊剖啣銝函撘嚗閮銝西ˊ雿蝚血撠撱園脫雿摨嚗璅蝯撠潸摨怎頂蝯梯賣靘游摮
' s1 q- v& U( ?+ x) X7 |, ]) T; q: z
$ y& h9 j5 n, r/ n3 M
銝爹ed Hat Enterprise Linux 4 (2.6 Kernel) 剝Oracle10G鞈摨怨蝔埋/O Scheduler皜祈岫蝯 (鞈靘皞撅昱edhat砍豢)' Q5 G: N4 I2 m6 f$ j
: z3 h$ q$ q3 ?( o3 ^) p5 F
' U3 O6 ?7 A- Y& Y6 B蝪∪桃閫鈭I/O Scheduler璅∪撌桃啣嚗臭誑撠銝脣閮剖靘剝銝I/O Scheduler脰賭隤踵∴擐曉啁恣I/O Scheduler蝟餌絞瑼獢嚗瑼獢舐牢at孵靘霈:
% G% O+ o7 I( m# n9 |0 ~2 Z g/ i( E( f7 B0 B0 W' p9 K
2 ^" Y" {' W7 A! a5 C3 s
#cat /sys/block/sda/queue/scheduler7 j, w# N- B+ G( R
[noop] anticipatory deadline cfq. w4 U* Z' O9 P! j( w V; `
9 r0 S8 y' o) W9 A9 j$ T
# f/ b0 `8 N7 }9 C$ Q/ C
敺銝靘嚗臭誑仿桀I/O Scheduler璅∪摸oop. (獢 [ ] ): L+ i5 k6 W1 H
2 ^0 a( z' V9 M8 q i
$ j% ]% Q- n' |
仿閬脰靽格寡矽湛雿瘜拍車:
6 L9 \' X7 `* ^# i% B B$ \" ~3 w7 { F8 x& M# C: G" x
0 K+ M( b$ M1 j1 r& S9 f
1. 格活隤踵湛唾矽游喟嚗蝬庸cho隞支湔遐/O Scheduler璅∪
" Z: T- }- }" n8 X) v' Q# \: I5 J1 p4 n0 m8 [% Z& C2 G' ^
3 W( m9 C& m) Z" N6 j& h* d# ]
#echo Deadline>/sys/block/sda/queue/scheduler. }1 _9 _9 x7 {& }( o7 \' ^
1 J% o1 ^$ W7 G8 h, h" f. L8 m
% G' g* o2 ^, I. W! q6 w$ { k銝靘箏桀sda憿蝖祉I/O Scheduler湔寧慣eadline璅∪嚗孵典喟嚗雿圈璈敺啁頂蝯望詨暺隤I/O Scheduler璅∪
$ r% F3 x) Q- A9 B& b/ k' g" P2 e; U T$ M6 w
/ E2 ^' s2 [9 N- ?
2. 刻蝟餌絞璈脰隤踵渡:
* |5 e2 L, ?, W/ I1 d0 y隞乩21% ], s6 h5 E+ Q9 G
/etc/rc.local 批乩銵: echo anticipatory > /sys/block/sdb/queue/scheduler 函頂蝯梁GRUB璈瑼獢銝哨敺銝銵銝elevator=deadline嚗喳舀潭甈⊿璈敺賭Deadline Scheduler雿璅∪嚗憒銝靘:
% |+ W6 h" k# V5 e* y1 z. V, @& p
& k0 p5 Q5 G6 T" T7 b$ u9 G9 a/ O+ @+ Y
蝺刻摩 /boot/grub/grub.conf9 W* a9 X. G5 [* p8 w. a3 j
* H" X/ ]$ \% L6 N+ V5 y
9 ]# B$ O+ ?8 J9 y8 Dtitle Fedora Core (2.6.9-5.0.3.EL_lustre.1.4.2custom)
& [1 K' d" v+ G. j Vroot (hd0,0)
7 n* P2 l. O- \- Nkernel /vmlinuz-2.6.9-5.0.3.EL_lustre.1.4.2custom ro! `0 y6 l a' v4 @3 Z4 o8 A
root=/dev/VolGroup00/LogVol00 rhgb noapic quiet elevator=deadline
, O0 U4 x+ q, { K& e2 A- Q* C7 N" H/ f
/ Q8 H5 w) W/ i5 u$ }) ^# t- N; G! N) {4 g- E/ j, o
- j% ^2 ^% F( y6 B% @鈭 乩靘舐′蝣 Readahead 敹怠& y9 X, p8 {5 l9 f% d! F
5 j- g0 }0 w& z/ n' y1 W
. ^- ^! g9 P: Z- {, I
其遢撠望頛摰寞閫嚗蝬梁頂蝯梁蝣霈閮剖靘霈踝蝬梯矽嵇eadahead Sectors憭批靘憓脩頂蝯梁蝣霈賢榆堆撠望航矽∠銝餉桃
0 [* E* A7 }8 I- i5 }% I
* w) R7 K0 t( l3 i0 D0 _' V4 q+ J+ L ]
蝬尉inux蝟餌絞隞: blockdev 靘瑼Z桀sda蝖祉Readahead Sectors憭批嚗蝭靘憒銝
# {: p9 m5 y) {+ w1 y# U3 {4 I. P5 J1 r0 X+ p9 Q
: s% Y" H4 R, M& R" x/ B#blockdev --getra /dev/sda (蝟餌絞閮剜256M): `, Z$ x5 r5 g8 k) ~' t7 v$ J
512
3 U' q& t; g: O. P7 D0 \ F+ ]4 t7 v4 j1 G! X; i$ e' |! \
# K. t0 t) G: f+ e蝬梯矽游訾蒂撣嗅兄ectors憭批嚗靘脰質矽湛蝭靘憒銝:
. _4 i- }9 `; D
- n5 Z, {* \# P
8 G8 J. G" j( ? d' I#blockdev --setra 4096 /dev/sda
4 Y. S% S5 g: G7 s$ Q
. S) z. {' [1 k" Y5 n* I+ T2 C9 g! h" O2 V( o' N
#blockdev --getra /dev/sda
3 N* e+ |9 k0 M& o4096
8 Q: {$ A, \9 u' _
" {- w' [4 _9 B刻蝟餌絞璈芸閮剖:3 Y4 k8 i3 e' A) B
/etc/rc.local 批乩銵:$ `- @! P! P6 B- w# ^* I k
blockdev --setra 4096 /dev/sda
# a$ g- l# G9 J. j) \- ` F) }* c, s T( _/ h. g
蝬拍車蝖祉質矽∠撠寞嚗舀賢典祈賢停瘥頛撌桃蝖祇啣銋銝嚗憭憯璁典箔鈭霈賬
! V; c2 b; ~/ }撖虫:隞亙鈕erver敺憭撌乩,靘憒 ffmpeg, php(move_uploaded_file)銝喳之瑼獢 ,tar , mv 憭抒瑼獢,雿撟曆∩,摰典銝鈭,蝬銝餈啁隤踵,憿摰刻圾瘙
! D9 z! Y! H* F0 R0 `
) x' a) J2 [0 k" w" C2 f$ j4 z血,sysctl.conf隤踵銋舀撟怠拍
9 K% x' U1 d7 I' k6 \/ h
, [) v- P5 E% E' H& v. |, j! |
' B9 p' s8 K/ G* X* m8 \靘皞:5 C/ [+ Q7 E% R2 N9 b# F J1 @
! G- u/ Q' A, l9 q; R
http://itstorage.storageforum.tw ... eadahead-cache.html$ Z* b( e! S$ h
|
|