vicidial_live_agents keeps locking
Posted: Fri Feb 27, 2015 10:40 am
We are running astguiclient for an inbound only campaign and getting constant db locks. most of the time the culprit is vicidial_live_agents table. this happens randomly, sometimes it runs without errors and problems for hours, and sometimes the LOCK statements become a nightmare, taking down the whole system down, restart mysql won't help and table again starts getting LOCKED. I have tried changing table engine (memory and myisam) but all in vain. Troubling "LOCK TABLES vicidial_live_agents" statement(s) always come from an asterisk server.
Here is a truncated "show processlist" output:
my.cnf looks like this:
Below i have listed all details of our vicidial setup
General Information:
1. OS: Ubuntu 12.04 LTS
2. Platform: VMWare
3. astguiclient versoin: 2.8-392c BUILD: 140312-2109
One Database Server:
CPU Cores: 16 Intel(R) Xeon(R) CPU X5570 @ 2.93GHz
RAM: 10G
Version: 5.5.7 milestone 15
Storage: vmdk on iSCSI
Replication: No
4 Asterisk Servers
Asterisk Version: 1.8.21.0-vici-beta
CPU: 8 Cores (Intel(R) Xeon(R) CPU X5570 @ 2.93GHz)
RAM: 4GB
Role: each server hosting ~30 agents
Phone Type: External (Routed to SIP gateway)
Storage: SAS
4 Web Servers
HTTP Server: Nginx
Clustered via pacemaker+heartbeat+ldirectord with (round robin connections - session based)
Here is a truncated "show processlist" output:
- Code: Select all
mysql> show processlist;
+--------+------+--------------------+----------+---------+------+---------------------------------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+--------+------+--------------------+----------+---------+------+---------------------------------+------------------------------------------------------------------------------------------------------+
| 831 | cron | xx.xx.xxx.59:33381 | asterisk | Sleep | 16 | | NULL |
| 855 | cron | xx.xx.xxx.68:52646 | asterisk | Query | 0 | starting | UPDATE server_updater set last_update='2015-02-27 14:45:43' where server_ip='xx.xx.xxx.68' |
| 393148 | cron | xx.xx.xxx.61:38109 | asterisk | Query | 63 | Waiting for table metadata lock | LOCK TABLES vicidial_live_agents WRITE |
| 394969 | cron | xx.xx.xxx.59:40535 | asterisk | Query | 61 | Waiting for table metadata lock | SELECT user FROM vicidial_live_agents where server_ip='xx.xx.xxx.59' and status IN('PAUSED') and ext |
| 394970 | cron | xx.xx.xxx.61:38175 | asterisk | Query | 61 | Waiting for table metadata lock | SELECT user FROM vicidial_live_agents where server_ip='xx.xx.xxx.61' and status IN('PAUSED') and ext |
| 394971 | cron | xx.xx.xxx.59:40536 | asterisk | Query | 62 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where closer_campaigns LIKE "% SWT7000 %" and last_update_ |
| 394972 | cron | xx.xx.xxx.61:38176 | asterisk | Query | 62 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where closer_campaigns LIKE "% SWT7000 %" and last_update_ |
| 394973 | cron | xx.xx.xxx.59:40537 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) FROM vicidial_live_agents where server_ip='xx.xx.xxx.59' and last_update_time < '201 |
| 394974 | cron | xx.xx.xxx.61:38177 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT user FROM vicidial_live_agents where callerid='Y2271440370000307785' |
| 395488 | cron | xx.xx.xxx.66:49632 | asterisk | Query | 61 | Waiting for table metadata lock | SELECT user,extension,status,uniqueid,callerid,lead_id,campaign_id,call_server_ip FROM vicidial_live |
| 395494 | cron | xx.xx.xxx.66:49633 | asterisk | Query | 62 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where closer_campaigns LIKE "% SWT7000 %" and last_update_ |
| 395516 | cron | xx.xx.xxx.66:49634 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) FROM vicidial_live_agents where server_ip='xx.xx.xxx.66' and last_update_time < '201 |
| 395613 | cron | xx.xx.xxx.68:57156 | asterisk | Query | 61 | Waiting for table metadata lock | SELECT user,extension,status,uniqueid,callerid,lead_id,campaign_id,call_server_ip FROM vicidial_live |
| 395623 | cron | xx.xx.xxx.68:57157 | asterisk | Query | 62 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where closer_campaigns LIKE "% LHR7000 %" and last_update_ |
| 395632 | cron | xx.xx.xxx.68:57158 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) FROM vicidial_live_agents where server_ip='xx.xx.xxx.68' and last_update_time < '201 |
| 396748 | cron | xx.xx.xxx.67:52729 | asterisk | Query | 63 | Waiting for table metadata lock | select UNIX_TIMESTAMP(last_call_time) from vicidial_live_agents where lead_id='342330' and status='I |
| 396888 | cron | xx.xx.xxx.69:60899 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) FROM vicidial_live_agents where user='userid' |
| 396995 | cron | xx.xx.xxx.62:53799 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='15408776' where user='userid' |
| 396997 | cron | xx.xx.xxx.67:52829 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 396998 | cron | xx.xx.xxx.62:53800 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 396999 | cron | xx.xx.xxx.62:53801 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397002 | cron | xx.xx.xxx.62:53806 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397012 | cron | xx.xx.xxx.69:60953 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='18279435' where user='userid' |
| 397016 | cron | xx.xx.xxx.67:52844 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397018 | cron | xx.xx.xxx.67:52843 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397021 | cron | xx.xx.xxx.69:60961 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397027 | cron | xx.xx.xxx.69:60964 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397031 | cron | xx.xx.xxx.69:60968 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='17103522' where user='userid' |
| 397037 | cron | xx.xx.xxx.62:53831 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397039 | cron | xx.xx.xxx.69:60969 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397048 | cron | xx.xx.xxx.67:52856 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='17133548' where user='userid' |
| 397196 | cron | xx.xx.xxx.69:32783 | asterisk | Query | 63 | Waiting for table metadata lock | select UNIX_TIMESTAMP(last_call_time) from vicidial_live_agents where lead_id='342285' and status='I |
| 397203 | cron | xx.xx.xxx.67:52878 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT status,callerid,agent_log_id,campaign_id,lead_id from vicidial_live_agents where user='userid' |
| 397204 | cron | xx.xx.xxx.69:32790 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT status,callerid,agent_log_id,campaign_id,lead_id from vicidial_live_agents where user='userid' |
| 397205 | cron | xx.xx.xxx.62:53904 | asterisk | Query | 63 | Waiting for table metadata lock | select UNIX_TIMESTAMP(last_call_time) from vicidial_live_agents where lead_id='342587' and status='I |
| 397207 | cron | xx.xx.xxx.62:53905 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='14291153' where user='userid' |
| 397208 | cron | xx.xx.xxx.58:43697 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='18385981' where user='userid' |
| 397209 | cron | xx.xx.xxx.69:32797 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT status,callerid,agent_log_id,campaign_id,lead_id from vicidial_live_agents where user='userid' |
| 397210 | cron | xx.xx.xxx.62:53917 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT status,callerid,agent_log_id,campaign_id,lead_id from vicidial_live_agents where user='userid' |
| 397211 | cron | xx.xx.xxx.58:43701 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397212 | cron | xx.xx.xxx.67:52887 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='15923753' where user='userid' |
| 397213 | cron | xx.xx.xxx.67:52886 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_ |
| 397214 | cron | xx.xx.xxx.55:38795 | asterisk | Sleep | 63 | | NULL |
| 397215 | cron | xx.xx.xxx.58:43703 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='17181695' where user='userid' |
| 397223 | cron | xx.xx.xxx.58:43709 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='15659998' where user='userid' |
| 397225 | cron | xx.xx.xxx.62:53924 | asterisk | Query | 63 | Waiting for table metadata lock | UPDATE vicidial_live_agents set random_id='13491614' where user='userid' |
| 397227 | cron | xx.xx.xxx.67:52893 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where ser |
| 397228 | cron | xx.xx.xxx.62:53925 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT status,callerid,agent_log_id,campaign_id,lead_id from vicidial_live_agents where user='userid' |
| 397236 | cron | xx.xx.xxx.62:53928 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397237 | cron | xx.xx.xxx.58:43714 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397239 | cron | xx.xx.xxx.67:52895 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where ser |
| 397241 | cron | xx.xx.xxx.62:53930 | asterisk | Query | 63 | Waiting for table metadata lock | select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agen |
| 397242 | cron | xx.xx.xxx.67:52897 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where ser |
| 397244 | cron | xx.xx.xxx.67:52899 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397249 | cron | xx.xx.xxx.62:53933 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397255 | cron | xx.xx.xxx.62:53953 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397256 | cron | xx.xx.xxx.67:52905 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397258 | cron | xx.xx.xxx.69:32813 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397259 | cron | xx.xx.xxx.58:43725 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397260 | cron | xx.xx.xxx.69:32815 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397264 | cron | xx.xx.xxx.62:53956 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397266 | cron | xx.xx.xxx.62:53959 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397267 | cron | xx.xx.xxx.58:43729 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397268 | cron | xx.xx.xxx.58:43730 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397269 | cron | xx.xx.xxx.58:43731 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397271 | cron | xx.xx.xxx.69:32816 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397274 | cron | xx.xx.xxx.58:43732 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397276 | cron | xx.xx.xxx.58:43734 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' ||
| 397318 | cron | xx.xx.xxx.62:53970 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397322 | cron | xx.xx.xxx.55:38798 | asterisk | Query | 63 | Waiting for table metadata lock | select closer_campaigns, count(*) as cnt from vicidial_live_agents where closer_campaigns IN (' ISB7 |
| 397324 | cron | xx.xx.xxx.58:43751 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397327 | cron | xx.xx.xxx.58:43753 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397330 | cron | xx.xx.xxx.69:32820 | asterisk | Query | 63 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' ||
| 397432 | cron | xx.xx.xxx.67:52943 | asterisk | Query | 62 | Waiting for table metadata lock | select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agen |
| 397434 | cron | xx.xx.xxx.67:52946 | asterisk | Query | 61 | Waiting for table metadata lock | DELETE from vicidial_live_agents where user ='6782' |
| 397436 | cron | xx.xx.xxx.62:54038 | asterisk | Query | 61 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397438 | cron | xx.xx.xxx.62:54040 | asterisk | Query | 61 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid'
| 397451 | cron | xx.xx.xxx.58:43761 | asterisk | Query | 59 | Waiting for table metadata lock | select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agen | |
| 397459 | cron | xx.xx.xxx.69:32872 | asterisk | Query | 59 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397467 | cron | xx.xx.xxx.67:52956 | asterisk | Query | 59 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397471 | cron | xx.xx.xxx.58:43764 | asterisk | Query | 59 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397473 | cron | xx.xx.xxx.69:32879 | asterisk | Query | 58 | Waiting for table metadata lock | UPDATE vicidial_live_agents set closer_campaigns=' KHI7000 -',last_state_change='2015-02-27 14:44:45 |
| 397476 | cron | xx.xx.xxx.58:43767 | asterisk | Query | 56 | Waiting for table metadata lock | SELECT agent_log_id from vicidial_live_agents where user='userid' |
| 397478 | cron | xx.xx.xxx.67:52961 | asterisk | Query | 54 | Waiting for table metadata lock | select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agen |
| 397481 | cron | xx.xx.xxx.61:38263 | asterisk | Query | 46 | Waiting for table metadata lock | UPDATE vicidial_live_agents SET ring_callerid='' where ring_callerid='Y2271440330000342591' |
| 397482 | cron | xx.xx.xxx.61:38264 | asterisk | Sleep | 13 | | NULL |
| 397485 | cron | xx.xx.xxx.59:40558 | asterisk | Sleep | 13 | | NULL |
| 397488 | cron | xx.xx.xxx.61:38270 | asterisk | Query | 42 | Waiting for table metadata lock | SELECT COUNT(*) FROM vicidial_live_agents WHERE campaign_id='IN7000' and status IN ('READY','QUEUE', |
| 397491 | cron | xx.xx.xxx.59:40563 | asterisk | Query | 42 | Waiting for table metadata lock | SELECT COUNT(*) FROM vicidial_live_agents WHERE campaign_id='IN7000' and status IN ('READY','QUEUE', |
| 397493 | cron | xx.xx.xxx.66:49646 | asterisk | Sleep | 13 | | NULL |
| 397496 | cron | xx.xx.xxx.66:49651 | asterisk | Query | 42 | Waiting for table metadata lock | SELECT COUNT(*) FROM vicidial_live_agents WHERE campaign_id='IN7000' and status IN ('READY','QUEUE', |
| 397497 | cron | xx.xx.xxx.68:57196 | asterisk | Sleep | 13 | | NULL |
| 397501 | cron | xx.xx.xxx.68:57202 | asterisk | Query | 42 | Waiting for table metadata lock | SELECT COUNT(*) FROM vicidial_live_agents WHERE campaign_id='IN7000' and status IN ('READY','QUEUE', |
| 397518 | cron | xx.xx.xxx.68:57204 | asterisk | Sleep | 0 | | NULL |
| 397519 | cron | xx.xx.xxx.68:57205 | asterisk | Sleep | 41 | | NULL |
| 397521 | cron | xx.xx.xxx.62:54058 | asterisk | Query | 31 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397522 | cron | xx.xx.xxx.62:54059 | asterisk | Query | 31 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397523 | cron | xx.xx.xxx.62:54060 | asterisk | Query | 31 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
| 397524 | cron | xx.xx.xxx.62:54061 | asterisk | Query | 31 | Waiting for table metadata lock | SELECT count(*) from vicidial_live_agents where user='userid' |
my.cnf looks like this:
- Code: Select all
#general params
skip-name-resolve
connect_timeout=60
wait_timeout = 28800
concurrent_insert=2
expire_logs_days=3
skip-host-cache
skip-external-locking
# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 2000
thread-cache-size = 100
open-files-limit = 65535
table-definition-cache = 1024
table-open-cache = 4000
# MyISAM #
key-buffer-size = 4G
myisam-recover-options = FORCE,BACKUP
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000
Below i have listed all details of our vicidial setup
General Information:
1. OS: Ubuntu 12.04 LTS
2. Platform: VMWare
3. astguiclient versoin: 2.8-392c BUILD: 140312-2109
One Database Server:
CPU Cores: 16 Intel(R) Xeon(R) CPU X5570 @ 2.93GHz
RAM: 10G
Version: 5.5.7 milestone 15
Storage: vmdk on iSCSI
Replication: No
4 Asterisk Servers
Asterisk Version: 1.8.21.0-vici-beta
CPU: 8 Cores (Intel(R) Xeon(R) CPU X5570 @ 2.93GHz)
RAM: 4GB
Role: each server hosting ~30 agents
Phone Type: External (Routed to SIP gateway)
Storage: SAS
4 Web Servers
HTTP Server: Nginx
Clustered via pacemaker+heartbeat+ldirectord with (round robin connections - session based)