Trying to insert data to confd via maapi api’s. In order to increase performance I’ve used threads because maapi_apply_trans is take little time and I’m doing every task in seperate transaction… Now i am dividing my list into tasks and applying tasks with threads. But nothing has changed rather than having single thread. Seems that threads are waiting each other to do maapi_apply_trans. I mean bottleneck is occured on confd. How to tackle with this?
First off - yes, you cannot have multiple maapi_apply_trans running (truly) in parallel; only one of them keeps the lock and is really being processed. And by splitting a large, long-running transaction into many smaller ones you probably actually made the problem even worse.
You should investigate where the actual bottleneck is, applying a transaction consists of many steps. CDB may not be the fastest storage around, but that alone is rarely the problem. You should inspect your developer log from one transaction and look for steps or phases where considerable amount of time is spent. Typical culprits are callbacks (like hooks, validation, subscribers), lengthy XPath evaluation to validate must statements, sometimes rollback file generation.