[SR-Users] Kamailio delayed reponse in case of database load
gdt at lexort.com
Tue Dec 10 17:37:51 CET 2019
Ali Taher <ataher at vanrise.com> writes:
> It normally takes few milliseconds to execute the query.
> The issue is occurring only at specific times where another
> application is inserting data into routing tables (not the live tables
> used by Kamailio, which will be swapped later to the live tables) ,
> where 300 CPS is flowing into kamailio.
You say these are being loaded into other tables. That implies that the
loading transaction shouldn't interfere with the read, but that's a good
thing to really check.
I would try two things, both to mitigate the problem as well as perhaps
1) Understand how your loading process uses transactions, and consider
if you can make transactions smaller. This might not be a good idea,
and it might not have any effect. But if you have one transactions with
6M inserts, and you don't need the atomicity, it might be better to have
600 transactions with 10k inserts.
2) Throttle the loading. You didn't say that you had a performance
requirement for loading, and you might do smoeting like insert 1000
records, sleep a second, and repeat. That could take 2h to load, and
I'm making up numbers anyway. My point is that if you can live with
slower loading, then that may avoid whatever the contention piont is,
even if you don't figure out the contention point.
More information about the sr-users