3月 062018
 

缘起:

使用dd读取一个大文件时,速度可达 100MB+/s, 但是cat读取大文件时,速度才达到 30MB/s,为何?

由于ceph块儿设备是从网络上读取数据,读取数据的效率和网络的性能由于直接关系,同时也和每次读取的块儿的大小有直接关系:

在块儿大小为100MB的情况下,读取速度可达到 120MB/s

在块儿大小为1MB的情况下,读取速度可达到 70MB/s

在块儿大小为64KB的情况下,读取速度可达到 30MB/s; ,然而cat命令每次read的大小正好是64KB

针对这种情况,如果本机有较大内存的话,不妨先通过dd大块儿的方法使得文件被cache起来,然后再做其它类似cat的操作;

 

另外: 增加IO大小,到达底层之后,会变成多个IO请求,相当于底层同时又多个IO请求,实际上是相当于增加了队列深度。

 Posted by at 下午 6:23

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据