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