# inconsistent performance

**URL:** <https://forums.percona.com/t/inconsistent-performance/1189>\
**Category:** Other MySQL® Questions\
**Created:** [June 9, 2009, 3:01pm UTC](https://forums.percona.com/t/inconsistent-performance/1189 "2009-06-09T15:01:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macloud](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Macloud](https://forums.percona.com/u/Macloud)\
**Post date:** [June 9, 2009, 3:01pm UTC](https://forums.percona.com/t/inconsistent-performance/1189/1 "2009-06-09T15:01:59Z")

</div>

Hi

We’re running MySQL 5.0 with MyISAM on a Dual-Core AMD with 8GB RAM.

The server runs as slave and for a single application - a PHP-CLI script that stops the slave, calcs some data for other machines and starts the slave again)

Some of the queries in the script are bigger joins or e.g. INSERT INTO … SELECT with about 2 million rows.

Sometimes one or more of the queries are lagging for no clear reason, e.g. the mentioned INSERT INTO … SELECT usually takes about 40 secs, but sometimes up to 200 secs (no other queries, table locks or something).

The machine doesn’t swap at all. I also tried to restart the MySQL server by script at the beginning or end of the script to make sure there are no unused buffers that have to be cleaned, etc. - didn’t help. Tuning-Primer had no “suggestions”.

MySQL config:

key\_buffer = 1024M  
max\_allowed\_packet = 64M  
table\_cache = 512  
sort\_buffer\_size = 16M  
read\_buffer\_size = 8M  
read\_rnd\_buffer\_size = 32M  
myisam\_sort\_buffer\_size = 64M  
tmp\_table\_size = 4096M  
max\_heap\_table\_size = 4096M  
thread\_cache\_size = 8  
query\_cache\_type = 0  
query\_cache\_size = 0M  
ft\_min\_word\_len = 2  
thread\_concurrency = 8  
max\_connections = 10

Any idea on how to find out what happens or what leads to that kind of problem? Checking MySQL status before or after the queries didn’t help.

TIA

Uwe

---

<div class="post-metadata">

**Author:** ![sterin71](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@sterin71](https://forums.percona.com/u/sterin71)\
**Post date:** [June 9, 2009, 5:05pm UTC](https://forums.percona.com/t/inconsistent-performance/1189/2 "2009-06-09T17:05:20Z")

</div>

Basically it could be anything.

If the query is the same all the time, then how about the execution plan or the data?

And even if the server doesn’t swap, what about IO activity during this time?  
The OS file cache (cached memory) might be used sometimes and sometimes not, hence it sometimes needs to write to disk during the execution.

If you want to continue to research this you must arrange so that you can get some information about what is happening in the system during the fast and the slow execution of the same query.
