123
返回列表 发新帖
楼主: 玉面飞龙

[笔记] 测试buffered I/O 和 direct I/O

[复制链接]
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
21#
发表于 2005-9-5 12:03 | 只看该作者
最初由 玉面飞龙 发布
[B]
1)disk sequence read 在direct IO下比Buffer IO稍微好一点 55s  VS 75s

2)direct IO下 usr比sy 要高好多, buffer IO下sy比usr要高。好事情?坏事情?

3)  in  中断  sy 系统调用   cs 上下文切换  direct IO 都比 buffer IO要高 。  好事情?坏事情?

4) Buffer IO下,vmstat cpu等待队列总是很高,而IO队列却较低;
  direct IO相反,cpu等待队列一般,但IO等待队列很高。

5)iostat的结果差不多

6)明显buffer IO的page in很高
[/B]


The more I think of it, the more difficult a good performance comparison may be. Buffered I/O has two effects that direct I/O does not have: filesystem caching and read prefetch. To avoid filesystem caching effect on reproducibility, you have to test, unmount the filesystem and test a second time. This may become unnecessary or partially unnecessary if very_big_table is much bigger than the size of filesystem cache, or in case table is read in noparallel mode by Oracle, that size plus Oracle buffer cache. (Speaking of this, ignore my last message that asks you to repeat the test with no parallel hint. Now I understand that you ran the test in parallel to avoid Oracle's caching!) You see there're a lot of parameters here. Your result (6) implies that you're either bringing in file data the first time, or very_big_table is large relative to filesystem cache.

Your result (1) implies the same, because the first time file data is brought in filesystem page cache, it takes a while. But if the cache is smaller than the all table blocks, even the subsequent reads are still slow. Since your test is sequential read, I think this also leads to a conclusion that read prefetch is not nearly as important as caching, i.e., even if prefetch is done in buffered I/O, this I/O is still slow simply because the data has to be copied twice (disks to kernel buffer, i.e. page cache, then from there to user space).

I don't have good explanations of other results. It's known that direct I/O uses less sys CPU time than buffered I/O. But that doesn't explain any of (2) to (5).

Yong Huang

使用道具 举报

回复
论坛徽章:
92
2011新春纪念徽章
日期:2011-01-25 15:42:33咸鸭蛋
日期:2012-03-19 10:46:00版主1段
日期:2012-05-15 15:24:11奥运会纪念徽章:排球
日期:2012-08-29 07:02:50奥运会纪念徽章:跳水
日期:2012-09-26 06:44:27ITPUB 11周年纪念徽章
日期:2012-09-28 17:34:42ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32奥运会纪念徽章:击剑
日期:2012-10-12 07:20:332013年新春福章
日期:2013-02-25 14:51:242012新春纪念徽章
日期:2012-02-13 15:13:20
22#
 楼主| 发表于 2005-9-5 13:46 | 只看该作者
最初由 Yong Huang 发布
[B]
You explain the high context switches with parallel executions. Then can you run it without parallel and see low context switches?

Yong Huang [/B]


测试了一下,不同的parallel slaves数目对context switches没有可观察到的影响

以前我认为,并行进程越多,越会引起cpu contention,进程的上下文切换越频繁,越影响系统性能; 看来光某个数字真说明不了什么

This may become unnecessary or partially unnecessary if very_big_table is much bigger than the size of filesystem cache, or in case table is read in noparallel mode by Oracle, that size plus Oracle buffer cache.

这个very_big_table 是比filesystem cache + oracle sga还要大。

Thank you very much.

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表