- we have database 2x12core 2.5ghz cpu 64gb ram raid 10 SSDs with mega raid card.
Load averages around 7 %CPU(s) 11% and IO wait is 0 or 0.2 at max.
we have 4 webservers
vicibox7 install SVN 3312
I noticed a bunch of forum articles about moving the table over to a memory table but I also noticed they say use caution here. We have 550 agents logged in and the closer_campaigns field has 100 characters per agent in it. do you think it would be okay, and a good ide for me to switch this to memory? I have 64gb ram and only ever appear to be using 17gb. (maybe my .cnf needs to be more aggressively tuned to use more Ram? see below for my.cnf)
Anything else that might be causing this table to lock or any other suggestions?
I am running AST_flush_DBqueue.pl --seconds=600 every 10 minutes.
Here is some below info:
When I look at MySQL process list I always see:
Waiting for table level lock. here are a few of the quires I see trying to run:
- Code: Select all
SELECT count(*) from vicidial_live_agents where user='1555' and server_ip='dialserver4'
SELECT agent_log_id from vicidial_live_agents where user='542'
UPDATE vicidial_live_agents set random_id='19275099' where user='723' and server_ip='dialserver6'
I looked at the Slow queries log and see the following:
Slow queries
- Code: Select all
SELECT count(*) FROM vicidial_live_agents where closer_campaigns LIKE "% closerqueue %";
# Time: 210113 9:02:34
# User@Host: cron[cron] @ localhost []
# Thread_id: 13539393 Schema: asterisk QC_hit: No
# Query_time: 3.841758 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0
SET timestamp=1610557354;
LOCK TABLES vicidial_live_agents WRITE;
SELECT agent_log_id from vicidial_live_agents where user='1467';
# User@Host: cron[cron] @ [Webserver1]
# Thread_id: 13539065 Schema: asterisk QC_hit: No
# Query_time: 6.425308 Lock_time: 2.944348 Rows_sent: 3 Rows_examined: 3
# Rows_affected: 0
SELECT status,callerid,agent_log_id,campaign_id,lead_id,comments from vicidial_live_agents where user='1171' and server_ip='dialserver19';
# User@Host: cron[cron] @ [dialserver1]
# Thread_id: 13541746 Schema: asterisk QC_hit: No
# Query_time: 3.166266 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0
SELECT lead_id,uniqueid,callerid,channel,call_server_ip,comments FROM vicidial_live_agents where server_ip = 'dialserver5' and user='402' and campaign_id='CLOSER' and status='QUEUE';
# User@Host: cron[cron] @ localhost []
# Thread_id: 13541502 Schema: asterisk QC_hit: No
# Query_time: 5.347642 Lock_time: 2.256797 Rows_sent: 1 Rows_examined: 499
# Rows_affected: 0
and here in my.cnf
- Code: Select all
log_bin=/var/lib/mysql/mysql-bin
binlog_format=mixed
server-id=1
slave-skip-errors = 1032,1690,1062
datadir=/var/lib/mysql
sql_mode=NO_ENGINE_SUBSTITUTION
skip-external-locking
skip-name-resolve
connect_timeout=60
long_query_time=3
slow_query_log=1
max_connections=4096
key_buffer_size=2G
max_allowed_packet=16M
table_open_cache=512
table_definition_cache=2048
open_files_limit=24576
sort_buffer_size=4M
net_buffer_length=8K
read_buffer_size=4M
read_rnd_buffer_size=16M
myisam_sort_buffer_size=128M
join_buffer_size=1M
thread_cache_size=100
query_cache_size=0
thread_concurrency=16
default-storage-engine=MyISAM
expire_logs_days=3
concurrent_insert=2
myisam_repair_threads=2
myisam_use_mmap=1
skip-innodb
delay_key_write=ALL
max_write_lock_count=1