Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 10 Threading Models and Tuning : Database Write Tuning Options for Cache Aside

Database Write Tuning Options for Cache Aside
This section explains how various properties affect the way RTC actions are processed and written to the database when both of these settings are used:
Agent.agentClassName.enableParallelOps=true
These properties affect how database operations in each RTC transaction are processed and committed to the backing store.
Tune for the Use Case  Tuning the parameters in this section can improve performance. However larger values do not imply improved performance.
For example, in heavy workload situations, increasing dbOpsBatchSize and dbOpsQueueSize values results in longer post-RTC times, which in turn delays release of cache locks — which are not released until after the post-RTC.
Database Write Queue and Thread Pool (Agent Level)
Actions for one or more RTCs are done in one or more batches, depending on tuning options. In each batch, TIBCO BusinessEvents does the following actions (as needed):
deleteConcepts
deleteEvents
insertConcepts
insertEvents
modifyConcepts
removeObjectTable
saveObjectTable
You can tune each agent’s database write behavior using the following options:

 
Agent.AgentClassName.dbOpsQueueSize
Agent.AgentClassName.dbOpsBatchSize
Agent.AgentClassName.dbthreadcount

 
The post-RTC database (backing store) transactions are queued into a database-operations queue whose maximum size (set per agent) is defined by dbOpsQueueSize. Each slot in the queue contains all the actions from one RTC.
Database write threads process the RTC transactions from the queue. The number of threads is defined by dbthreadcount.
A database write thread takes up to the dbOpsBatchSize number of RTC transactions, processes them and commits them to the database. (When database write threads are idle, they take available jobs from the database operations queue, even if there are less jobs than dbOpsBatchSize.)
You can monitor JMX parameter AvgDBOpsBatchSize to see the effective value used in your use case.
For reference documentation see Table 57, CDD Agent Classes Tab Inference Agent and Query Agent Properties in TIBCO BusinessEvents Developer’s Guide.
Database Batching Option (Cluster Level)
When the following cluster-level property is set to true:
be.engine.cluster.useDBBatching
And when the following agent level property is set to greater than one:
Agent.AgentClassName.dbOpsBatchSize
Then all the RTC transactions in one batch are handled as one job (in agents that have the property set to a number larger than one).
It is important to balance the cost of processing fewer, larger jobs against the gains. The efficiencies gained by setting the useDBBatching property to true are greater if many operations of the same kind apply to the same table. The database writing process has to do an operation for each of update, insert and delete on each database table. So you don't get any gain if only one RTC in the batch is updating, inserting, or deleting in a particular table.
For reference documentation see Table 50, CDD Cluster Tab Backing Store Properties in TIBCO BusinessEvents Developer’s Guide.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved