DFS lock handle 等待事件


RAC环境中非常频繁的使用序列(sequence)。则'DFS lock handle'等待事件经常会出现。

通常的办法是增大序列缓存,且不使用排序选项即NOORDER。

创建序列时 默认的cache是20, 非排序NOORDER.
通过如下语句更新序列缓存:

alter sequence SEQ_name  cache 200;
 

 

RAC and sequences [ID 853652.1]中的一段话:

 

When caching + ordering is used and RAC is enabled (cluster_database = true), 
then the session wanting to get the NEXTVAL of a sequence need to get 
an exclusive instance SV lock before inserting or updating the sequence values 
in the the shared pool. When multiple sessions want the nextval of the same sequence,
then some sessions will wait on 'DFS lock handle' waitevent with id1 equal to 
the sequence number.

========================================================================================

If you are using Oracle sequences very frequently in a RAC environment,

most often you will see that one of the most timed events is “DFS Lock Handle”.

Commonly you should set the sequence to have a larger cache size and with the NOORDER option, which is the default,

for best performance.

 

Performance of combined options worst to best:

  • NOCACHE with ORDER
  • NOCACHE with NOORDER
  • CACHE with ORDER
  • CACHE with NOORDER

Few more things to note

    • High volume insert intensive applications using Sequence generated keys add extra overhead
      NOCACHE is the worst for performance
    • CACHE NOORDER is the best for performance
    • Services may help improve performance even for CACHE NOORDER sequences if the insert application uses a service with only one Preferred Instance.
    • This eliminates the Interconnect traffic and synchronisation overhead required to coordinate the next value from amongst all the instances when using CACHE ORDER

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM