linux io调度,linux IO调度器

This scheduler only implements request merging.

Anticipatory IO Scheduler ("as scheduler")

The anticipatory scheduler is the default

scheduler in older 2.6 kernels – if you’ve not specified one, this is

the one that will be loaded. It implements request merging, a one-way

elevator, read and write request batching, and attempts some

anticapatory reads by holding off a bit after a read batch if it thinks a

user is going to ask for more data. It tries to optimise for physical

disks by avoiding head movements if possible – one downside to this is

that it probably give highly erratic performance on database or storage

systems.

Deadline Scheduler

The deadline scheduler implements request

merging, a one-way elevator, and imposes a deadline on all operations to

prevent resource starvation. Because writes return instantly within

linux, with the actual data being held in cache, the deadline scheduler

will also prefer readers – as long as the deadline for a write request

hasn’t passed. The kernel docs suggest this is the preferred scheduler

for database systems, especially if you have aware disks, or any system with high disk performance.

Complete Fair Queueing Scheduler ("cfq scheduler")

The complete fair queueing scheduler implements

both request merging and the elevator, and attempts to give all users of

a particular device the same number of IO requests over a particular

time interval. This should make it more efficient for multiuser systems.

It seems that Novel SLES sets cfq as the scheduler by default, as does

the latest release. As of the 2.6.18 kernel, this is the default schedular in kernel.org releases.

Changing Schedulers

The most reliable way to change schedulers is to

set the kernel option ‘elevator’ at boot time. You can set it to one of

"as", "cfq", "deadline" or "noop", to set the appropriate scheduler.

It seems under more recent 2.6 kernels (2.6.11,

possibly earlier), you can change the scheduler at runtime by echoing

the name of the scheduler into

/sys/block//queue/scheduler, where devicename is the

base name of the block device, eg sda for /dev/sda

Which one should I use?

I’ve not personally done any testing on this, so I

can’t speak from experience yet. The anticipatory scheduler will be the

default one for a reason however – it is optimised for the common case.

If you’ve only got single disk systems (ie, no RAID – hardware or

software) then this scheduler is probably the right one for you. If it’s

a multiuser system, you will probably find cfq or deadline providing

better performance, and the numbers seem to back deadline giving the

best performance for database systems.

Tuning the IO schedulers

The schedulers may have parameters that can be tuned at runtime. Read the linux documentation on the schedulers listed in the section below

More information

Read the documents mentioned in the  section below, especially the linux kernel documentation on the anticipatory and deadline schedulers.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值