# Sporadically slow MyISAM inserts

**URL:** <https://forums.percona.com/t/sporadically-slow-myisam-inserts/403>\
**Category:** Other MySQL® Questions\
**Created:** [August 4, 2007, 3:10pm UTC](https://forums.percona.com/t/sporadically-slow-myisam-inserts/403 "2007-08-04T15:10:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjuk](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gjuk](https://forums.percona.com/u/gjuk)\
**Post date:** [August 4, 2007, 3:10pm UTC](https://forums.percona.com/t/sporadically-slow-myisam-inserts/403/1 "2007-08-04T15:10:51Z")

</div>

I have a simple MyISAM table (8 fields; 22 bytes per row plus c. 40 bytes of index per row). Currently, the table has several million rows - and I run frequent bulk inserts, each of a few few hundred thousand rows. Typically, it inserts c. 5000 rows per second, but occasionally a row takes 5-60 seconds to insert. This happens perhaps every 2,000-20,000 rows or so. I notice that the IO wait in Linux ‘top’ command can go as high as 90% during the insert process, so guess it’s to do with disk writing. Is there any buffer which could help?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [August 16, 2007, 6:43am UTC](https://forums.percona.com/t/sporadically-slow-myisam-inserts/403/2 "2007-08-16T06:43:00Z")

</div>

It could be flushing key buffer or simply dirty pages from MYD file.

---

<div class="post-metadata">

**Author:** ![gjuk](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@gjuk](https://forums.percona.com/u/gjuk)\
**Post date:** [August 16, 2007, 8:01am UTC](https://forums.percona.com/t/sporadically-slow-myisam-inserts/403/3 "2007-08-16T08:01:07Z")

</div>

Thanks Peter

Would there be anything which would identify which of these it was, or how would you fix it?

Alternatively - someone at Rackspace suggested that it might be rebuilding the indexes. Would that sound likely?

Many thanks again!
