Cdr_engine - taskprocessor.c

I get the following warning on asterisk log
taskprocessor.c: The ‘subm:cdr_engine-00000003’ task processor queue reached 5000 scheduled tasks again. Asterisk is configured with real time sip and we use fastagi (in JAVA) to read dialplan from an mysql database. With 20 cps if it reaches to 400 calls the calls start to retransmit, If a try to make a new call from zoiper the status will be trying,after 40-60 second everything goes back to normal. I have the same configuration on another server, as far as I know because it’s not me who has configured it and it works ok even with 30-40 cps, No retransmission. If I disable the cdr module everything is ok.Also I removed fastagi and used the extensional.conf file and still the same problem.

That message means that the CDR backend is likely taking time to persist the records. It depends on what backend you are using as to what the bottleneck could be - it could be the disk, it could be database if that is in use. An option you can use is exploring CDR batching (the batch option in cdr.conf) which moves persisting outside of that path.

with cdr batch enabled it works ok, but it will lose cdr records if the server shutdown for any reason, even with the safe shutdown option, the database is mariadb, we have developed an application in php but the php code has nothign to do with the insertion of cdr record in DB. we use real time sip and the dialplans are stored in DB. it uses fastagi in java to retrieve the dialplan. can you give me some possible reasons that this happens?

I have the same DB configuration, the same fastagi program and the same backend in another server and it works ok. I am not sure about asterisk configuration because those were done by another person

I have no additional reasons to give - the posting of CDRs is getting backlogged due to the database. You’d need to investigate slow queries, see how the database is responding, that kind of thing.

I checked mariadb configuration and everything is ok, i compared them with another server that I have. The other server works ok with 30cps. On the other hand this server works ok with 10 cps but it blocks with 20 or 30 cps. I don’t think that this is a mariadb problem. I also checked the unixODBC driver version, tried the latest version from git,still the same problem.