重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2546|回复: 0
打印 上一主题 下一主题

[参数设置] db_writer_processes 和 dbwr_io_slaves参数详解

[复制链接]
跳转到指定楼层
楼主
发表于 2020-8-19 15:59:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 windjack 于 2020-8-19 16:01 编辑

db_writer_processes 和 dbwr_io_slaves参数说明

--------------------------------------------------------------------------------------------------------------

在计算机世界里,磁盘的发展速度远低于cpu和memory。
磁盘io现在已经成为计算机的瓶颈,对于oracle的db系统。
磁盘io更是重要。在oracle里为了提高io的速度,常用参数db_writer_processes 和 dbwr_io_slaves
在数据库里事务数非常高,或db cache很大,一个DBWn process跟不上数据的load,
我们可以调整这两个参数,这两个参数的作用就是增加io读写进程,启用异步io,加快io的速度
多个 slaves 可以并行写数据文件,而多个dbwr也可以并行写数据文件
一个 dbwr 多个 slaves是 dbwr 搜集dirty  buffer 而 slaves 写数据文件
多个dbwr 可以并行地搜集dirty buffer 并且并行地写数据文件
但是如果系统支持AIO一般不用设置多dbwr 或者 io slaves
db_writer_processes:在多cpu,多磁盘的环境,一般是每8个cpu一个dbwr进程

什么时候配置这两个参数
如果系统的io是瓶颈是,检查os是否支持异步io,如果支持异步io,
但目前没有使用,那就启用异步io来缓解io瓶颈。如果os不支持异步io,
或os已经启用异步io,但io还是瓶颈,那我们可以配置多个dbwr进程。
配置这两个参数是要注意,大都是如下:
db_writer_processes=1时,dbwr_io_slaves>0;
db_writer_processes>1时,dbwr_io_slaves=0.





官网解释:http://download.oracle.com/docs/ ... 3/instance_tune.htm

Consider Multiple Database Writer (DBWR) Processes or I/O Slaves
Configuring multiple database writer processes, or using I/O slaves, is useful when the transaction rates are high or when the buffer cache size is so large that a single DBWn process cannot keep up with the load.

DB_WRITER_PROCESSES
The DB_WRITER_PROCESSES initialization parameter lets you configure multiple database writer processes (from DBW0 to DBW9 and from DBWa to DBWj). Configuring multiple DBWR processes distributes the work required to identify buffers to be written, and it also distributes the I/O load over these processes. Multiple db writer processes are highly recommended for systems with multiple CPUs (at least one db writer for every 8 CPUs) or multiple processor groups (at least as many db writers as processor groups).

Based upon the number of CPUs and the number of processor groups, Oracle either selects an appropriate default setting for DB_WRITER_PROCESSES or adjusts a user-specified setting.

DBWR_IO_SLAVES
If it is not practical to use multiple DBWR processes, then Oracle provides a facility whereby the I/O load can be distributed over multiple slave processes. The DBWR process is the only process that scans the buffer cache LRU list for blocks to be written out. However, the I/O for those blocks is performed by the I/O slaves. The number of I/O slaves is determined by the parameter DBWR_IO_SLAVES.

DBWR_IO_SLAVES is intended for scenarios where you cannot use multiple DB_WRITER_PROCESSES (for example, where you have a single CPU). I/O slaves are also useful when asynchronous I/O is not available, because the multiple I/O slaves simulate nonblocking, asynchronous requests by freeing DBWR to continue identifying blocks in the cache to be written. Asynchronous I/O at the operating system level, if you have it, is generally preferred.

DBWR I/O slaves are allocated immediately following database open when the first I/O request is made. The DBWR continues to perform all of the DBWR-related work, apart from performing I/O. I/O slaves simply perform the I/O on behalf of DBWR. The writing of the batch is parallelized between the I/O slaves.


--------------------------------------------------------------------------------
Note:
Implementing DBWR_IO_SLAVES requires that extra shared memory be allocated for I/O buffers and request queues. Multiple DBWR processes cannot be used with I/O slaves. Configuring I/O slaves forces only one DBWR process to start.

--------------------------------------------------------------------------------


Choosing Between Multiple DBWR Processes and I/O Slaves
Configuring multiple DBWR processes benefits performance when a single DBWR process is unable to keep up with the required workload. However, before configuring multiple DBWR processes, check whether asynchronous I/O is available and configured on the system. If the system supports asynchronous I/O but it is not currently used, then enable asynchronous I/O to see if this alleviates the problem. If the system does not support asynchronous I/O, or if asynchronous I/O is already configured and there is still a DBWR bottleneck, then configure multiple DBWR processes.


--------------------------------------------------------------------------------
Note:
If asynchronous I/O is not available on your platform, then asynchronous I/O can be disabled by setting the DISK_ASYNCH_IO initialization parameter to FALSE.

--------------------------------------------------------------------------------


Using multiple DBWRs parallelizes the gathering and writing of buffers. Therefore, multiple DBWn processes should deliver more throughput than one DBWR process with the same number of I/O slaves. For this reason, the use of I/O slaves has been deprecated in favor of multiple DBWR processes. I/O slaves should only be used if multiple DBWR processes cannot be configured.


-------end--------




分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

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

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-24 14:13 , Processed in 0.132264 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表