Raw Device vs File System

原文 http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7931107631402

1, 在文中,TOM详细解释了 filesystem与raw device的区别及我们常用的四个存储方式的区别:
1)  Cooked" operating system (OS) file systems
2)Raw partitions
3) Automatic Storage Management (ASM)
4) Clustered file system

(其实还有NFS, 2004年淘宝从mysql移植到oracle时用,netapp的NFS设备做工RAC)

并说明了raw device并不一定比filesystem性能要好, it depend!


2. 优化的焦点是减少IO次数,一般是从应用设计入手,比如多用cache, 批量提交等, 然后才是将IO分散. (strip,mirror)

3. 建议用ASM, 如果不能用ASM ,则用filesystem (带DIRECTIO选项), 不建议直接用raw devices

4,  不能用SQL语句的性能与dd测试作对比.
     如果一定要对比的话, 最相近的是 insert append (direct path write).
    最好是用是模拟ORACLE读写协议的orion工具测试存储性能,再与dd命令测试出来的对比. 文中TOM及kevin详细解释了原因. 并解释了提倡使用raw( 在ASM中使用)的好处

 ASM是结合了filesystem的易管理性有raw的性能.

ASM comes with the database
ASM doesn't require additional software to be purchased.
ASM does database stuff only, it is optimized to be a database file system and nothing else
ASM provides clustered access without any additional software to be purchased
ASM provides the DBA with management features that the DBA should have - not the "SA", the DBA

5, 减少LIO's 往往会减少PIO's

6, 不建议使用SSD, 贵,并且可能从其它渠道获得性能的提升,抵销它的优势
   实际上,几年前看过一份公司新技术评测部门测试华为SSD的报告, SSD只适合某些IO特性. 可能少批量分是可以的, 据说百度在大量使用.

 

7, 客户端是不会等待下述几个事件,会等待log file sync
but clients do NOT wait for db file parallel write, log file parallel write, control file parallel
write.

clients do wait for log file sync, every time you issue COMMIT. 

8, 建议除了Oracle层面对controfile, redo作镜外外,在硬件层也要mirror,比如放raid10上

9, 找数据的顺序, 注意11gR2中出现了flash cache (次序)
A read from the buffer cache.

It would be preferable to find the data we need in:

a) the buffer cache
b) the flash cache (new in 11g Release 2)
c) the OS filesystem cache
d) on disk

in that order. Now, if you make the buffer cache larger - then we'll never get to (c) and (c) is much much slower than (a)

(a) would be preferred. So, make the cache large enough to account for the secondary SGA effect when you switch from cooked to raw (ASM would be preferred actually, it is raw, but easier/more flexible to manage database stuff with)

10, 续上,查找数据顺序 (读的逻辑)
Assuming no flashcache (new 11g R2 feature), we

a) take the DBA (data block address, (block#, file#) and hash it.
b) we search a list in the cache identified by that hash for this block
c) if we don't find it in cache we do physical IO. Physical IO might come from OS filesystem cache or not, we don't know, we don't care, we don't influence that at all.
d) we put block into that list in the cache and return it.



TOM广泛精准的知识,不愧为Oracle'百科全书'

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/94384/viewspace-677828/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/94384/viewspace-677828/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值