# mysql percona slowdown

**URL:** <https://forums.percona.com/t/mysql-percona-slowdown/2926>\
**Category:** Other MySQL® Questions\
**Created:** [September 6, 2013, 4:06am UTC](https://forums.percona.com/t/mysql-percona-slowdown/2926 "2013-09-06T04:06:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stormdust](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@stormdust](https://forums.percona.com/u/stormdust)\
**Post date:** [September 6, 2013, 4:06am UTC](https://forums.percona.com/t/mysql-percona-slowdown/2926/1 "2013-09-06T04:06:57Z")

</div>

Hi there people.  
Im having a damn dificult problem with one mysql server that keeps getting slowing down when it gets spikes of heavy queries.

We have our project mounted like this:  
-frontend in iis 7.5 and framework 4.5  
-api in iis 7.5 with wcf and net.pipe(frontend) and mysql connector 6.3(DB)  
-Database with mysql Percona Server (GPL), Release 31.0 (5.5.32-rel31.0)

When i have spikes on the api or when im deploying the project api sometimes everthing stops responding, when i go evaluate what is happening i see this:  
-frontend low cpu (large queue request)  
-api low cpu (large queue requests)  
-mysql slow down (many queries that run in 0 to 100 milliseconds → pass to 1second-5seconds)

When this happen the last time i try the following:  
-i put the front end in schedule for not to receive any requests  
-i put the api in schedule for not to receive any requests  
-i have killed the front end w3wp process to clean up  
-i have killed the api w3wp process to clean up  
-i have killed all the processes on the mysql

Try to start everthing but the mysql didnt recover, keeps slowing, the only way i have to stabilise the project is with a restart on the mysql server.

Data / Requests per second  
-20 in average  
-by request i have 10-20 storeprocedures invokes  
-mysql server is with 3.5G´s RAM ocupied and swap is at 4Gb´s

Configurations on mysql percona server  
Server virtualized  
4 CPU Cores (6GHZ´s)  
4Gb´s Ram  
40Gb´s virtual disc  
one Database with 4Gb´s of information  
200 tables  
3000 Storeprocedures

[mysql]  
[mysqld]

# GENERAL

group\_concat\_max\_len = 65535  
user = mysql  
default\_storage\_engine = InnoDB  
socket = /var/run/mysqld/mysqld.sock  
pid\_file = /var/run/mysqld/mysqld.pid  
skip-external-locking  
wait\_timeout = 30  
interactive\_timeout = 30  
max\_connections = 50  
thread\_concurrency = 8

# MyISAM

key\_buffer\_size = 256M  
myisam\_recover = FORCE,BACKUP

# SAFETY

max\_allowed\_packet = 16M  
max\_connect\_errors = 1000000

# DATA STORAGE

datadir = /mnt/data/mysql  
tmpdir = /tmp

# BINARY LOGGING

log\_bin = /mnt/data/mysql/mysql-bin  
binlog\_format = ‘ROW’  
expire\_logs\_days = 1  
sync\_binlog = 1

# CACHES AND LIMITS

tmp\_table\_size = 128M  
max\_heap\_table\_size = 128M  
query\_cache\_type = 0  
query\_cache\_size = 0  
thread\_cache\_size = 50  
open\_files\_limit = 65535  
table\_definition\_cache = 4096  
table\_open\_cache = 10240  
myisam\_sort\_buffer\_size = 64M

# INNODB

innodb\_flush\_method = O\_DIRECT  
innodb\_file\_per\_table = 1  
innodb\_flush\_log\_at\_trx\_commit = 1  
innodb\_buffer\_pool\_size = 2G

# LOGGING

general-log-file = /var/log/mysql/mysql.log  
log\_error = /var/log/mysql/error.log  
slow\_query\_log\_file = /var/log/mysql/slow.log  
log\_queries\_not\_using\_indexes = 0  
slow\_query\_log = 2

# TEXT SEARCH

ft\_min\_word\_len = 2

# OTHERS

key\_buffer = 32M  
read\_buffer\_size = 2M  
read\_rnd\_buffer\_size = 16M  
bulk\_insert\_buffer\_size = 64M  
max\_allowed\_packet = 16M  
[mysqldump]  
quick  
max\_allowed\_packet = 32M  
[myisamchk]  
key\_buffer\_size = 256M  
sort\_buffer\_size = 256M  
read\_buffer = 2M  
write\_buffer = 2M  
[mysqlhotcopy]  
interactive-timeout

any thoughs where i should go to try catch what is causing this on my dabase server?

---

<div class="post-metadata">

**Author:** ![przemek](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/przemek/32/3_2.png) [@przemek](https://forums.percona.com/u/przemek)\
**Post date:** [September 10, 2013, 5:25am UTC](https://forums.percona.com/t/mysql-percona-slowdown/2926/2 "2013-09-10T05:25:52Z")

</div>

So the database server lives on dedicated VM, right? What did you observe there? CPU bound, IO bound? What about memory, was the server swapping during the slowdown? Our tools like [pt-stalk](http://www.percona.com/doc/percona-toolkit/2.2/pt-stalk.html) run in critical moment could provide you many details about the situation.  
Another thing is some of your per session buffers really high. What was the reason you set :  
read\_buffer\_size = 2M  
read\_rnd\_buffer\_size = 16M  
?  
Check this article: [URL][http://ronaldbradford.com/blog/dont-assume-per-session-buffers-2010-03-08/[/URL]](http://ronaldbradford.com/blog/dont-assume-per-session-buffers-2010-03-08/%5B/URL%5D)

---

<div class="post-metadata">

**Author:** ![stormdust](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@stormdust](https://forums.percona.com/u/stormdust)\
**Post date:** [January 25, 2016, 6:49am UTC](https://forums.percona.com/t/mysql-percona-slowdown/2926/3 "2016-01-25T06:49:49Z")

</div>

The problem was in the connector, i made some tweeks on it to improve it and this problem disapered.
