From 223afa019a7cf6aa9c1ca0597b4fd01abc32d2ce Mon Sep 17 00:00:00 2001 From: honpey Date: Sat, 18 Mar 2017 18:33:32 +0800 Subject: [PATCH] honpey translate How to Change Linux IO Scheduler --- ...160104 How to Change Linux IO Scheduler.md | 73 ------------------- ...160104 How to Change Linux IO Scheduler.md | 66 +++++++++++++++++ 2 files changed, 66 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20160104 How to Change Linux IO Scheduler.md create mode 100644 translated/20160104 How to Change Linux IO Scheduler.md diff --git a/sources/tech/20160104 How to Change Linux IO Scheduler.md b/sources/tech/20160104 How to Change Linux IO Scheduler.md deleted file mode 100644 index 363a2db8cb..0000000000 --- a/sources/tech/20160104 How to Change Linux IO Scheduler.md +++ /dev/null @@ -1,73 +0,0 @@ -honpey is tranlating - -How to Change Linux I/O Scheduler -================================== - - -Linux I/O Scheduler is a process of accessing the block I/O from storage volumes. I/O scheduling is sometimes called disk scheduling. Linux I/O scheduler works by managing a block device’s request queue. It selects the order of requests in the queue and at what time each request is sent to the block device. Linux I/O Scheduler manages the request queue with the goal of reducing seeks, which results in great extent for global throughput. - -There are following I/O Scheduler present on Linux: - -1. noop – is often the best choice for memory-backed block devices -2. cfq – A fairness-oriented scheduler. It tries to maintain system-wide fairness of I/O bandwidth. -3. Deadline – A latency-oriented I/O scheduler. Each I/O request has got a deadline assigned. -4. Anticipatory – conceptually similar to deadline, but with more heuristics to improve performance. - -To View Current Disk scheduler: - -``` -# cat /sys/block//queue/scheduler -``` - -Let’s assume that , disk name is /dev/sdc, type: - -``` -# cat /sys/block/sdc/queue/scheduler -noop anticipatory deadline [cfq] -``` - -### To change Linux I/O Scheduler For A Hard Disk: - -To set a specific scheduler, simply type below command: - -``` -# echo {SCHEDULER-NAME} > /sys/block//queue/scheduler -``` - -For example,to set noop scheduler, enter: - -``` -# echo noop > /sys/block/sdc/queue/scheduler -``` - -The above change is valid till reboot of the server , to make this change permanent across reboot follow below procedure: - -Implement permanent setting by adding “elevator=noop” to the default para in the /boot/grub/menu.lst file - -#### 1. Create backup of menu.lst file - -``` -cp -p /boot/grub/menu.lst /boot/grub/menu.lst-backup -``` - -### 2. Update /boot/grub/menu.lst - -Now add “elevator=noop” at the end of the line as below: - -Example - -``` -kernel /vmlinuz-2.6.16.60-0.91.1-smp root=/dev/sysvg/root splash=silent splash=off showopts elevator=noop -``` - --------------------------------------------------------------------------------- - -via: http://linuxroutes.com/change-io-scheduler-linux/ - -作者:[UX Techno][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linuxroutes.com/change-io-scheduler-linux/ diff --git a/translated/20160104 How to Change Linux IO Scheduler.md b/translated/20160104 How to Change Linux IO Scheduler.md new file mode 100644 index 0000000000..6d9e56141b --- /dev/null +++ b/translated/20160104 How to Change Linux IO Scheduler.md @@ -0,0 +1,66 @@ +如何更改IO调度器 +================================== + +Linux IO 调度器,IO调度器也叫磁盘调度器。Linux IO调度器的机制主要是控制块设备的请求队列:确定队列中哪些IO的优先级更高以及何时下发IO,以此来减少磁盘寻道时间,从而提高系统的吞吐量。 + +目前Linux上有如下几种IO调度算法: + +1. noop - 通常用于内存存储的设备. +2. cfq - 绝对公平调度器. 进程平均使用IO带宽. +3. Deadline - 每一个IO,都有一个最晚执行时间. +4. Anticipatory - 启发式调度,类似Deadline算法,但是引入预测机制提高性能. + +查看设备当前的IO调度器: + +``` +# cat /sys/block//queue/scheduler +``` + +假设磁盘名称是 /dev/sdc: + +``` +# cat /sys/block/sdc/queue/scheduler +noop anticipatory deadline [cfq] +``` + +### 如何改变硬盘设备I/O调度器 + +使用如下指令: + +``` +# echo {SCHEDULER-NAME} > /sys/block//queue/scheduler +``` + +比如设置 noop 调度器: + +``` +# echo noop > /sys/block/sdc/queue/scheduler +``` + +以上设置重启后会失效,要想重启后配置仍生效,需要在内核启动参数中将 "elevator=noop" 写入 /boot/grub/menu.lst: + +#### 1. 备份 menu.lst 文件 + +``` +cp -p /boot/grub/menu.lst /boot/grub/menu.lst-backup +``` + +#### 2. 更新 /boot/grub/menu.lst + +将 "elevator=noop" 添加到文件末尾,比如: + +``` +kernel /vmlinuz-2.6.16.60-0.91.1-smp root=/dev/sysvg/root splash=silent splash=off showopts elevator=noop +``` + +-------------------------------------------------------------------------------- + +via: http://linuxroutes.com/change-io-scheduler-linux/ + +作者:[UX Techno][a] +译者:[honpey](https://github.com/honpey) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxroutes.com/change-io-scheduler-linux/