| Sporadically slow MyISAM inserts [message #1572] |
Sat, 04 August 2007 16:40  |
gjuk Messages: 2 Registered: August 2007 |
Junior Member |
|
|
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!
[Updated on: Sat, 04 August 2007 16:41]
|
|
|
|
|
| Re: Sporadically slow MyISAM inserts [message #1610 is a reply to message #1609 ] |
Thu, 16 August 2007 10:39  |
Peter Messages: 405 Registered: August 2006 |
Senior Member Super Guru |
|
|
Rebuilding indexes can be happen only when you insert to empty table otherwise it does not work
there is index merge which is done with bulk inserts (controlled by bulk_insert_tree_size variable) but it happens on each insert.
I'd probably strace MySQL at the time therer is active disk activity.
Also you can look how your Key% variables are changes if there are a lot of key blocks being written you should see it
Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.mysqlperformanceblog.com/mysql-consulting/
|
|
|