rdbms ipc message等待事件与SQL*Net message from client

rdbms ipc message

The background processes (LGWR, DBWR, LMS0) use this event to indicate that they are idle and are waiting for the foreground processes to send them an IPC message to do some work.

Wait Time: Up to 3 seconds. The parameter timeout shows the true sleep time.

Parameter:                            Description
timeout                                The amount of time that the session waits for an IPC message
       

 


等待事件里有100多个SQL*Net message from client,正常不?
有人说过SQL*Net message from client等待事件一定忽略吗?!所有的只是说一般情况下,这些事件可以被忽略,但凡事都没有那么绝对!!
SQL*Net message from client等待事件不一定就可以被忽略,也不一定就是因为网络问题。

SQL*Net message from client
The server process (foreground process) waits for a message from the client process to arrive.

Wait Time: The time it took for a message to arrive from the client since the last message was sent to the client

Parameter Description
driver id See "driver id"
#bytes The number of bytes received by the server (foreground process) from the client.


以下引用::
其实都是《Optimizing Oracle Performance By Cary Millsap 》里的观点:

作者不喜欢把等待事件分为idle和non-idle,作者更喜欢把等待事件分为between/within database call,作者并不认同idle wait event就是不
重要的,就可以被忽略不计,作者认为只要诊断数据收集方法正确,那么在response time中占主导地位的wait event就是重要的,就必须予以重视,即使这样的等待事件是idle wait event,比如SQL*Net message from client等待事件:

比如大致的说一下作者在12.3 Case 3中列举的分析案例

# REALLY BAD, unscalable application code
for each v in (897248, 897249, ...)
{
  c = parse("select ... where rderid = ".v);  # just ignore the result
  c = parse("select ... where rderid = ".v);  # do the same parse again
  execute(c);
  data = fetch(c);
  close_cursor(c);
}

在每次的database call之间就存在着SQL*Net message from client等待事件,也是作者所说的一种between database call等待事件,当出现大
量的不必要的database call的时候,虽然单独的每个SQL*Net message from client等待事件时间间隔很短,但大量的database call累计起来导
致SQL*Net message from client成为分析案例的最主要的等待事件,显然这里的SQL*Net message from client等待时间导致response time很
大,它显然不能被忽略不计,它也不是因为网络问题,而是因为存在大量不必要的database call,作者的解决方案就是:通过使用绑定变量,将parse移到循环外部,以及使用array fetch,bulk insert等减少database call的次数,从而减少response time


我的理解,原代码中:
for each v in (897248, 897249, ...)
{
c = parse("select ... where rderid = ".v); # just ignore the result  -- 
这是一个 database call
c = parse("select ... where rderid = ".v); # do the same parse again  这也是一个 database call
execute(c); -- 这也是一个 database call
data = fetch(c); -- 这也是一个 database call
close_cursor(c);  -- 这也是一个 database call
}

在每个 database call 之间,就是SQL*Net message from client, 作者的意思是:
应该采用绑定变量的方法来减少的分析(parse)这一块,
从而减少 database call,来减少SQL*Net message from client;这是
优化策略之一,此外,采用 array fetch,bulk insert等方法,可以减
少 execute(c),data = fetch(c),close_cursor(c)  的次数,因此也可以
减少,database call,和 SQL*Net message from client。

 


知道的多的人补充,谢谢

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

转载于:http://blog.itpub.net/24873454/viewspace-677881/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值