Page 1 of 1

mysql slowing down

PostPosted: Wed Dec 12, 2007 12:42 pm
by gardo
we're having this weird issue. we have 20 plus agents dialing on multiple campaigns on a multi-server setup w/ 1 mysql/apache and 1 vicidial server. the system dials fine on the first couple of minutes and slowly but surely slows down. there will be agents on different campaigns waiting for more than 5 minutes. we have traced the problem to mysql slowing down. running "mysql -u cron -h 192.168.1.220 -p" normally connects instantly. however, when we're encountering the said issue, it takes a couple of seconds. this is what we have:

astguiclient 2.0.3
asterisk 1.2.24
mysql 5.0.22
centos 5

running mtop: mtop --dbuser=root --seconds=3 --password=demian77 shows this:

load average: 0.57, 0.31, 0.28 mysqld 5.0.22 up 0 day(s), 16:55 hrs
47 threads: 1 running, 0 cached. Queries/slow: 7.7M/0 Cache Hit: 99.30%
Opened tables: 0 RRN: 3.1K TLW: 7.9K SFJ: 0 SMP: 0 QPS: 294

ID USER HOST DB TIME COMMAND STATE INFO
662365 root localhost Query show full processlist
662653 unauthen 192.168.1.222:38 Connect login
662759 unauthen 192.168.1.222:38 Connect login
662771 unauthen 192.168.1.222:38 Connect login
662794 unauthen 192.168.1.222:38 Connect login
662796 unauthen 192.168.1.222:38 Connect login
662826 unauthen 192.168.1.222:38 Connect login
662827 unauthen 192.168.1.222:38 Connect login
662839 unauthen 192.168.1.222:38 Connect login
662880 unauthen 192.168.1.222:38 Connect login
662881 unauthen 192.168.1.222:38 Connect login
662886 unauthen 192.168.1.222:38 Connect login
662887 unauthen 192.168.1.222:38 Connect login
662889 unauthen 192.168.1.222:38 Connect login
662973 unauthen 192.168.1.222:38 Connect login
663073 unauthen 192.168.1.222:38 Connect login
663114 unauthen 192.168.1.222:38 Connect login
663115 unauthen 192.168.1.222:38 Connect login
663138 unauthen 192.168.1.222:38 Connect login
663148 unauthen 192.168.1.222:38 Connect login
663149 unauthen 192.168.1.222:38 Connect login
663160 unauthen 192.168.1.222:38 Connect login
663174 unauthen 192.168.1.222:38 Connect login
663194 unauthen 192.168.1.222:38 Connect login
663198 unauthen 192.168.1.222:38 Connect login
663212 unauthen 192.168.1.222:38 Connect login
663213 unauthen 192.168.1.222:38 Connect login

is this normal?

PostPosted: Wed Dec 12, 2007 1:24 pm
by Op3r
Nope.

Check your load if it isnt the load.

Check your network settings :)

PostPosted: Wed Dec 12, 2007 2:09 pm
by gardo
We have already checked everything. Load is not a problem since the mysql/apache server is a core 2 quad system. Network is also not an issue since it's on a LAN.

PostPosted: Wed Dec 12, 2007 3:07 pm
by mflorell
Are you using "--skip-name-resolve --skip-host-cache" when you start mysqld?

PostPosted: Wed Dec 12, 2007 3:51 pm
by gardo
That might be one of the reason. However, I have resolved the issue by changing the default config file to accomodate more requests. CentOS has some examples under /usr/share/doc/mysql-server-5.0.22/. Adding the the IP address and the hostnames in /etc/hosts also helped as suggested by Op3r.

If I'm not mistaken, that's almost equivalent to "--skip-name-resolve --skip-host-cache".

PostPosted: Thu Dec 13, 2007 1:56 pm
by mflorell
There are a lot of settings in /etc/my.cnf that can help you to optimize how MySQL runs. If you are running a large system it would be worth looking at those settings.