Cluster 1 DB, 6 diallers, 1 Web, 1 Slave.
Vicidial version: 2.10b0.5
SVN Version: 2173
We got database locks for more than 20 seconds, up to a minute on several occasions lately, since we started a new campaign.
After some digging, it turned out that most likely the issue is with inbound calls to a specific DID, where DID setting In-Group Call Handle Method is set to CIDLOOKUPRCALT.
Such calls to this DID, apparently from unknown or alt phone, create records in MasterDB-slow.log like this:
- Code: Select all
# Time: 150612 12:33:28
# User@Host: cron[cron] @ [192.168.200.22]
# Thread_id: 37724435 Schema: asterisk QC_hit: No
# Query_time: 26.609920 Lock_time: 0.000034 Rows_sent: 0 Rows_examined: 7987121
SET timestamp=1434108808;
SELECT lead_id,called_count from vicidial_list where alt_phone='7500XXXXXX' order by last_local_call_time desc limit 1;
Please note Query_time: 26.609920
In the DID settings, campaign and list are set properly. The campaign has 2 short lists only.
Why the resulting query missed the list clauses?
The way I am reading agi-VDAD_ALL_inbound.agi, the following 2 clauses where list_id(s) are picked, do not apply for xxxxxxALT searches, meaning at least LOOKUPRLALT and LOOKUPRCALT methods would not get any list_ids:
- Code: Select all
if ($call_handle_method =~ /LOOKUPRL$/)
{$listSQL = "and list_id='$list_id'";}
else
{
if ($call_handle_method =~ /LOOKUPRC$/)
{
### Grab all lists associated with Scampaign_id
I've looked at the latest version of agi-VDAD_ALL_inbound.agi and couldn't find any related changes since our version.
As a side question, are there any issues adding another index alt_phone in vicidial_list table?