Linux 核心2 .6 加速

此篇取自 http://free.tnc.edu.tw/modules/news/article.php?storyid=950
Opensource 開發實驗室的 Andrew Morton道:Linux 2.6 核心 將介紹改進後的 IO 排定,這將可以可以增加速度 -- "有時候增加 1,000% 或是更多, 對於桌上型電腦[大部份則是 2x], 15% 資料庫處理等等。增加速度的方法則是在閱讀的時候減少磁頭的動作。
關於更多請參考:


以下轉載於 http://story.news.yahoo.com/news?tmpl=story&cid=75&e=2&u=/nf/20040405/tc_nf/23603
The New Linux Speed Trick
Linux kernel 2.6 introduces improved IO scheduling that can increase speed -- "sometimes by 1,000 percent or more, [more] often by 2x" -- for standard desktop workloads, and by as much as 15 percent on many database workloads, according to Andrew Morton of Open Source Development Labs. This increased speed is accomplished by minimizing the disk head movement during concurrent reads.
There are two scheduling policies included in kernel 2.6: the anticipatory scheduler, and the deadline scheduler. Kernel 2.6 lets the user choose which scheduling method to use, Linus Torvalds , the creator of Linux, told NewsFactor. "Right now, that choice is made globally at boot time and can't be changed later," he said, "but that may still change."
The default scheduler for kernel 2.6 is the anticipatory scheduler, and the deadline scheduler is the alternate option.
Oh, the Anticipation
The anticipatory scheduling is so named because it anticipates processes doing several dependent reads. In theory, this should minimize the disk head movement. Without anticipation, the heads may have to seek back and forth under several loads, and there is a small delay before the head returns for a seek to see if the process requests another read.
"Basically, the anticipatory scheduler maintains some per-process statistics to try to guess whether there will be another dependent read 'soon,'" Torvalds explained. The anticipatory scheduler is best suited to standard desktop and fileserver loads. In fact, it was while using the anticipatory scheduling that Morton experienced up to 1,000 percent speed increases on some workloads.
Most likely, the basic user never will need to tweak the scheduler, but it can be done. You can tune your anticipatory scheduler to improve its functionality. There are five basic parameters you can alter to change the way the wait-before-seek times function: read_expire, read_batch_expire, write_expire, write_batch_expire, and antic_expire.
Meeting the Deadline
The deadline scheduler has two additional scheduling queues that were not available to the 2.4 IO scheduler. The two new queues are a FIFO read queue and a FIFO write queue. This new multi-queue method allows for greater interactivity by giving the read requests a better deadline than write requests, thus ensuring that applications rarely will be delayed by read requests.
Deadline scheduling is best suited for database servers and high disk performance systems. Morton has experienced up to 15 percent increases on database loads while using deadline scheduling.
Filesystem Questions
How will these new IO scheduling methods affect such filesystems as Reiserfs, and Ext3? Torvalds assures us that "as the scheduling goes, that should all be transparent to the filesystem." If anything, the IO scheduling should improve access to IO request ordering. Currently, there is no interface for filesystems to use, and none are planned for the near future, according to Morton.
Hans Reiser, the leading force behind Reiserfs, told NewsFactor that the latest version of the filesystem, Reiser4, basically ignores the lower layer. "Some tests we did suggest that Reiser4's allocate on flush makes it much more efficient for multiple streams of I/O," he noted.
Reiser also hinted that after Reiser4 is shipped, his team may look into trying to take advantage of the improved IO scheduling. Specifically, they are interested in the possibility of creating file plugins that obey real-time constraints and use scheduler plugins.
Ext 3 Improvements
Ext3 is not "explicitly" taking advantage of the changes to the IO scheduler, "because no extra code is required in the filesystem to use the scheduler," says Red Hat's kernel development systems engineer, Stephen Tweed.
However, there are many improvements to Ext3 in 2.6 that are not related to the IO Scheduler, Tweed told NewsFactor. In particular, the SMP locking is vastly improved, increasing scalability on large machines. And there is support for "htree" indexing, providing much better performance on large directories.

作者: Tsung

對新奇的事物都很有興趣, 喜歡簡單的東西, 過簡單的生活.

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料