2.6内核的四种调度算法
In the 2.6 kernel serIEs,there are four interchangeable schedulers,as follows:
cfq- “Completely Fair Queuing” makes a good default for most workloads on general-purpose servers.
as – “Anticipatory Scheduler” is best for workstations and other systems with slow,single-spindle storage.
deadline – “Deadline” is a relatively simple scheduler which trIEs to minimize I/O latency by re-ordering requests to improve performance. Deadline的I/O调度器,在数据吞吐量非常大的数据库系统中表现得更有优势。
noop- “NOOP” is the most simple scheduler of all,and is really just a single FIFO queue.
修改默认的IO调度算法
There are two ways to change the I/O scheduler – at boot time,or with new kernels at runtime. For all linux kernels,appending ‘elevator={noop|deadline}’ to the kernel boot string sets the I/O elevator.
With GRUB,append the string to the end of the kernel command:
Title Fedora Core (2.6.9-5.0.3.EL_lustre.1.4.2custom)
root (hd0,0)
kernel /vmlinuz-2.6.9-5.0.3.EL_lustre.1.4.2custom ro
root=/dev/VolGroup00/LogVol00 rhgb noAPIc quIEt elevator=deadline
With newer linux kernels (Red Hat Enterprise linux v3 Update 3 does not have this feature. It is present in the main linux tree as of 2.6.15),one can change the scheduler while running. If the file /sys/block/<DEVICE>/queue/scheduler exists (where DEVICE is the block device you wish to affect),it will contain a List of available schedulers and can be used to switch the schedulers.
(sda is the <disk>):
[root@cfs2]# cat /sys/block/sda/queue/scheduler
noop [anticipatory] deadline cfq
[root@cfs2 ~]# echo deadline > /sys/block/sda/queue/scheduler
[root@cfs2 ~]# cat /sys/block/sda/queue/scheduler
noop anticipatory [deadline] cfq
The other schedulers (anticipatory and cfq) are better suited for desktop use.
查看当前的IO调度算法
dmesg | grep -i schedular
英文信息copy from lustre manual
总结以上是内存溢出为你收集整理的2.6内核改变系统IO调度算法全部内容,希望文章能够帮你解决2.6内核改变系统IO调度算法所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)