To ensure that heavier workloads that use column-organized data do not overload the system when many queries are submitted simultaneously, there is a limit on the number of "heavyweight" queries that can run against a database at the same time.
You can implement this limit by using the default workload management concurrency threshold. This threshold is automatically enabled on new databases if you set the value of the DB2_WORKLOAD registry variable to ANALYTICS. You can manually enable the threshold on existing databases.
The processing of queries against column-organized tables is designed to run fast by using the highly parallelized in-memory processing of data. The trade-off for this high performance is that queries that reference column-organized tables also use a relatively large amount of memory and CPU when compared to similar queries processing row-organized table data. As such, the execution of queries that process column-organized tables is optimal when relatively few queries are admitted to the system at a time. When this occurs, the queries can use more processing power and memory, and contention for the processor caches is minimized.
Also, field experience with DB2® workload management has demonstrated that in analytic environments that support mixed workloads, controlling the admission of heavyweight queries into the system yields improvements in both system stability and overall performance. A mixed workload environment is one in which queries might vary widely in their degree of complexity and resource needs. The reason for the improvements is that resource overload on the system is avoided. When the limit on the number of heavyweight queries is reached, the remaining queries are queued and must wait until other queries are complete before they can run. Queuing can help to ensure system stability when many complex ad hoc queries are running on systems that do not have a specific workload management strategy. To further optimize the execution of mixed workloads on your system, review the full range of DB2 workload management capabilities. For details, see Implementing DB2 workload management in a data warehouse.
In a customized workload management environment, the expectation is that this default concurrency control might not be required. You can leave it enabled to manage the work that maps to the SYSDEFAULTUSERCLASS superclass or disable it.
A limit on the number of queries that can run concurrently should protect the system from overload but also avoid over-throttling the workload to a point where performance might suffer. This objective can be challenging when a system is running ad hoc analytic queries that range widely in complexity and impact. The default limit is based on a heuristic calculation that factors in system hardware attributes such as the number of CPU sockets, CPU cores, and threads per core. The limit is calculated based on the current host configuration when the default workload management objects for concurrency control are created during database creation or upgrade. The limit is recalculated when you run the DB2 Configuration Advisor against the database. Rerun the DB2 Configuration Advisor if you make changes to the host, such as enabling or removing CPU capacity.
Although the objective is to provide basic query management for analytic data mart deployments without the need for manual intervention, there might be scenarios where adjustments to the default configuration are a good idea.
Only the following subset of workload management DDL statements is supported by the default workload management objects for concurrency control in DB2 Version 10.5.
# Enable the default work action mapping so that
# heavyweight queries are mapped to the
# SYSDEFAULTMANAGEDSUBCLASS subclass
ALTER WORK ACTION SET SYSDEFAULTUSERWAS ENABLE
# Disable the default work action mapping so that all
# queries are mapped to the SYSDEFAULTSUBCLASS subclass
ALTER WORK ACTION SET SYSDEFAULTUSERWAS DISABLE
# Modify the default work class timeron range from A to B
ALTER WORK CLASS SET SYSDEFAULTUSERWCS
ALTER WORK CLASS SYSMANAGEDQUERIES FOR TIMERONCOST FROM <A> TO <B>
# Enable the concurrency threshold
ALTER THRESHOLD SYSDEFAULTCONCURRENT ENABLE
# Disable the concurrency threshold
ALTER THRESHOLD SYSDEFAULTCONCURRENT DISABLE
# Change the concurrency limit to [N]
ALTER THRESHOLD SYSDEFAULTCONCURRENT
WHEN CONCURRENTDBCOORDACTIVITIES > [N] CONTINUE
alter-threshold-exceeded-actions
AND QUEUEDACTIVITIES
The recommended method for tuning the default object settings is to examine the overall system resource usage with a full workload and to perform incremental adjustments that are based on whether the system resources appear to be under-utilized or over-utilized. A system with a run queue depth of approximately 10 times the number of CPU cores and physical memory usage under 100% is considered to be in a fully used and healthy state.