[asterisk-dev] func_cdr performance issue

Jaco Kroon jaco at uls.co.za
Mon Jan 11 05:37:50 CST 2021


Hi All,

I am very much new to the way in which statis functions.  Is there
documentation somewhere around the design of this I should be looking at?

Our primary issue is that both cdr_read and cdr_write in func/func_cdr.c
gets very slow (up to four seconds, sporadically).  We're using cdr_odbc
back-end.

We suspect after looking into the code on func_cdr side that this is due
to stasis basically sending a message via statis to the cdr engine, and
then getting delayed due to the SQL process sometimes being slow on
COMMIT phase of transactions.

I'm thinking of a few possible things that can be done here on the
asterisk (without having checked whether this may be the case already):

1.  Switch to batched processing (which hopefully posts multiple
transactions in a single transaction).
2.  Decouple finalization of CDRs from the main CDR thread.
3.  Semi batch process where if (and only if) CDRs batch up they're
batch processed into a single transaction (ie, grab all outstanding,
post them, reply success to all).

Happy to put in the work, would just like to understand better as to how
this works so that I don't lay down a fair amount of work for little to
no gain at all.

From a hardware side we're also busy looking into upgrades w.r.t. disks
that may help (one consideration is to just add a small NVMe just for
the SQL database).  Just to be clear we're not just attacking this from
one front.

Kind Regards,
Jaco





More information about the asterisk-dev mailing list