PX qref latch等待事件分析

在并行执行的情况下偶然会发现PX qref latch等待事件,当系统高峰期同时采用了高并发的情况下最容易出现。看来要进行特殊照顾了。

概念和原理
在并行执行环境中,query slaves 和query coordinator之间是通过队列交换数据和信息的。PX qref latch 是用来保护这些队列的。
PX qref latch 等待事件的出现一般表明信息的发送比接受快,这时需要调整buffer size(可以通过parallel_execution_message_size参数调整)。
但是有些情况下也是难以避免发生这种情况的,比如consumer需要长时间的等待数据的处理,原因在于需要返回大批量的数据包,这种情况下很正常。

调整和措施
当系统的负载比较高时,需要把并行度降低;如果使用的是默认并行度,可以通过减小parallel_thread_per_cpu参数的值来达到效果。
DEFAULT degree = PARALLEL_THREADS_PER_CPU * #CPU's 

优化parallel_execution_message_size参数
Tuning parallel_execution_message_size is a tradeoff between
performance and memory. For parallel query, the connection
topology between slaves and QC requires (n^2 + 2n) connections
(where n is the DOP not the actual number of slaves) at maximum. 
If each connection has 3 buffers associated with it then you can
very quickly get into high memory consumption on large machines 
doing high DOP queries.

posted on 2010-08-23 09:41  大肚熊  阅读(1054)  评论(0编辑  收藏  举报

导航