by sunnyday » Tue Jun 28, 2016 12:29 pm
*EDIT*: MEMORY seems fine, don't use INNODB.
I've been fighting this issue for days now and finally have a solution. In general, MyISAM tables can be problematic under heavy/multi-thread usage.I converted vicidial_live_agents into a MEMORY table and the system is now stable again.
*BEFORE* doing this, make sure your database has been checked and repaired. Also, make sure you have a bit of additional ram available... say ~250KB per simultaneously logged-in agent (just a guess). MySQL ram settings may need to be adjusted for this as well if you have a lot of agents.
I first made a back-up of the table and then recreated it while replacing the TEXT fields with varchar(1000). This is simply because MEMORY tables don't support TEXT/BLOB field types. My system doesn't seem to be using these fields at all and I'm not sure how much space they need. If you run into issues with this try increasing the length to something larger, say 4000, which will require more ram.
Here's the MySQL code to do it:
ALTER TABLE `asterisk`.`vicidial_live_agents` RENAME TO `asterisk`.`vicidial_live_agentsBAK`;
CREATE TABLE `vicidial_live_agents` (
`live_agent_id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`user` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`server_ip` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`conf_exten` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`extension` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` enum('READY','QUEUE','INCALL','PAUSED','CLOSER','MQUEUE') COLLATE utf8_unicode_ci DEFAULT 'PAUSED',
`lead_id` int(9) unsigned NOT NULL,
`campaign_id` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL,
`uniqueid` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`callerid` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`channel` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`random_id` int(8) unsigned DEFAULT NULL,
`last_call_time` datetime DEFAULT NULL,
`last_update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`last_call_finish` datetime DEFAULT NULL,
`closer_campaigns` varchar(1000) COLLATE utf8_unicode_ci,
`call_server_ip` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
`user_level` tinyint(3) unsigned DEFAULT '0',
`comments` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`campaign_weight` tinyint(1) DEFAULT '0',
`calls_today` smallint(5) unsigned DEFAULT '0',
`external_hangup` varchar(1) COLLATE utf8_unicode_ci DEFAULT '',
`external_status` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
`external_pause` varchar(20) COLLATE utf8_unicode_ci DEFAULT '',
`external_dial` varchar(100) COLLATE utf8_unicode_ci DEFAULT '',
`external_ingroups` varchar(1000) COLLATE utf8_unicode_ci,
`external_blended` enum('0','1') COLLATE utf8_unicode_ci DEFAULT '0',
`external_igb_set_user` varchar(20) COLLATE utf8_unicode_ci DEFAULT '',
`external_update_fields` enum('0','1') COLLATE utf8_unicode_ci DEFAULT '0',
`external_update_fields_data` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
`external_timer_action` varchar(20) COLLATE utf8_unicode_ci DEFAULT '',
`external_timer_action_message` varchar(255) COLLATE utf8_unicode_ci DEFAULT '',
`external_timer_action_seconds` mediumint(7) DEFAULT '-1',
`agent_log_id` int(9) unsigned DEFAULT '0',
`last_state_change` datetime DEFAULT NULL,
`agent_territories` varchar(1000) COLLATE utf8_unicode_ci,
`outbound_autodial` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT 'N',
`manager_ingroup_set` enum('Y','N','SET') COLLATE utf8_unicode_ci DEFAULT 'N',
`ra_user` varchar(20) COLLATE utf8_unicode_ci DEFAULT '',
`ra_extension` varchar(100) COLLATE utf8_unicode_ci DEFAULT '',
`external_dtmf` varchar(100) COLLATE utf8_unicode_ci DEFAULT '',
`external_transferconf` varchar(120) COLLATE utf8_unicode_ci DEFAULT '',
`external_park` varchar(40) COLLATE utf8_unicode_ci DEFAULT '',
`external_timer_action_destination` varchar(100) COLLATE utf8_unicode_ci DEFAULT '',
`on_hook_agent` enum('Y','N') COLLATE utf8_unicode_ci DEFAULT 'N',
`on_hook_ring_time` smallint(5) DEFAULT '15',
`ring_callerid` varchar(20) COLLATE utf8_unicode_ci DEFAULT '',
`last_inbound_call_time` datetime DEFAULT NULL,
`last_inbound_call_finish` datetime DEFAULT NULL,
`campaign_grade` tinyint(2) unsigned DEFAULT '1',
`external_recording` varchar(20) COLLATE utf8_unicode_ci DEFAULT '',
`external_pause_code` varchar(6) COLLATE utf8_unicode_ci DEFAULT '',
`pause_code` varchar(6) COLLATE utf8_unicode_ci DEFAULT '',
`preview_lead_id` int(9) unsigned DEFAULT '0',
PRIMARY KEY (`live_agent_id`),
KEY `random_id` (`random_id`),
KEY `last_call_time` (`last_call_time`),
KEY `last_update_time` (`last_update_time`),
KEY `last_call_finish` (`last_call_finish`),
KEY `vlali` (`lead_id`),
KEY `vlaus` (`user`)
) ENGINE=MEMORY AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Last edited by
sunnyday on Tue Jun 28, 2016 12:56 pm, edited 1 time in total.