PARALLEL_THREADS_PER_CPU

Property Description
Parameter type Integer
Default value Operating system-dependent, usually 2
Modifiable ALTER SYSTEM
Range of values Any nonzero number

Note:
This parameter applies to parallel execution in exclusive mode as well as in a Real Application
Clusters environment.

PARALLEL_THREADS_PER_CPU specifies the default degree of parallelism for the instance and
determines the parallel adaptive and load balancing algorithms. The parameter describes the
number of parallel execution processes or threads that a CPU can handle during parallel execution.

The default is platform-dependent and is adequate in most cases. You should decrease the value
of this parameter if the machine appears to be overloaded when a representative parallel query
is executed. You should increase the value if the system is I/O bound.

Goal

The purpose of this parameter "PARALLEL_THREADS_PER_CPU"

Solution

PARALLEL_THREADS_PER_CPU enables you to adjust for hardware configurations with I/O subsystems
that are slow relative to the CPU speed and for application workloads that perform. few
computations relative to the amount of data involved. If the system is neither CPU-bound nor
I/O-bound, then the PARALLEL_THREADS_PER_CPU value should be increased. This increases the default
DOP and allow better utilization of hardware resources.


DOP specifies the number of available processes, or threads, used in parallel operations. Each
parallel thread may use one or two query processes depending on the query's complexity.
The adaptive multi-user feature adjusts DOP based on user load. For example, you may have a table
with a DOP of 5. This DOP may be acceptable with 10 users. But if 10 more users enter the system
and you enable the PARALLEL_ADAPTIVE_MULTI_USER feature, Oracle reduces the DOP to spread
resources more evenly according to the perceived system load.

It is best to use the parallel adaptive multi-user feature when users process simultaneous
parallel execution operations.

The adaptive multi-user algorithm has several inputs. The algorithm first considers the number of
allocated threads as calculated by the database resource manager. The algorithm then considers the
default settings for parallelism as set in INIT.ORA, as well as parallelism options used in CREATE
TABLE and ALTER TABLE commands and SQL hints.

When a system is overloaded and the input DOP is larger than the default DOP, the algorithm uses
the default degree as input. The system then calculates a reduction factor that it applies to the
input DOP.

The initialization parameter PARALLEL_THREADS_PER_CPU affects algorithms controlling both the DOP
and the adaptive multi-user feature. Oracle multiplies the value of PARALLEL_THREADS_PER_CPU by
the number of CPUs per instance to derive the number of threads to use in parallel operations.

The adaptive multi-user feature also uses the default DOP to compute the target number of query
server processes that should exist in a system. When a system is running more processes than the
target number, the adaptive algorithm reduces the DOP of new queries as required. Therefore, you
can also use PARALLEL_THREADS_PER_CPU to control the adaptive algorithm.

The default for PARALLEL_THREADS_PER_CPU is appropriate for most systems. However, if your I/O
subsystem cannot keep pace with the processors, you may need to increase the value for
PARALLEL_THREADS_PER_CPU. In this case, you need more processes to achieve better system
scalability. If too many processes are running, reduce the number.

2. From the session where the query run, type:
select * from v$pq_sesstat;

STATISTIC LAST_QUERY SESSION_TOTAL
------------------------------------------------------------
Queries Parallelized 1 1

The above row tells us that the last query run in this session was parallelized.

3. Check in v$ views for slave activity:
Select from v$pq_slave a couple of times:

SELECT slave_name,status, cpu_secs_total
FROM v$pq_slave;

v$session wait can also be queried to look for PQ activity.

You can detect the use with the following statement for a version greater than 8.x

SELECT sid, event, seq#,p1,p2,p3, wait_time
FROM v$session_wait
WHERE upper(event) like ('PX%')
ORDER BY 1;

4. Trace the Query coordinator using <10046> Level 12:10046>
Look for parallel query wait events in the resultant trace file. Also look for trace files from the query slaves.


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

转载于:http://blog.itpub.net/11083/viewspace-151827/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值