Database Write Tuning Options
Various properties affect how database operations in each RTC transaction are processed and committed to the backing store.
These properties affect the way RTC actions are processed and written to the database when the following property is used:
Agent.
agentClassName
.enableParallelOps=true
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.
Database Batching Option (Cluster Level)
All RTC transactions in one batch can be handled as one job (in agents that have the property set to a number larger than one) depending on the cluster-level property setup.
To achieve that, the following cluster-level property has to be set to true:
be.engine.cluster.useDBBatching
and the following agent level property has to be set to greater than one:
Agent.AgentClassName
.dbOpsBatchSize
In this case, 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 TIBCO BusinessEvents Developer’s Guide.