Arjen posted a good note about MyISAM concurrent-insert features, though I should mention concurrent-insert can be cause of
scalablity and peformance problems on SMP boxes, especially on queries processing range-queries. The reason of problems is POSIX read-write locks, which are used to protect key_buffer from concurrent changes and called for each processed row. More info you can get from my UC2006 talk, in short on main platforms (Linux, Solaris, Windows) rw-locks have a bad implementation and too many calls cause waste of CPU in user-space (Solaris) or kernel-space (Linux).

Some results for MyISAM table, query

, id – primary key.
Boxes: Sun V40z, Solaris 10, 4 x Dual Core Opteron @ 2.2GHz (8 logical cpu), 16GB of RAM, StorEdge 3310
and Quadxeon, RedHat AS 3, 2.4.21-15.Elsmp, 4 x Intel(R) XEON(TM) MP CPU 2.00GHz, 4GB of RAM, SATA RAID 10
The results in queries per sec (more is better)

threadsQuadxeon
with enabled concurrent-insert
Quadxeon
–skip-concurrent-insert
Sun V40z
with enabled concurrent-insert
Sun V40z
–skip-concurrent-insert
144.0864.8261.06129.13
232.63123.3352.63244.03
424.95176.6220.03463.62
819.92206.8112.34483.47
1619.73208.6612.3428.35
3219.77212.8312.25445.66

So if you are using range-queries and doing INSERT not often than disabling concurrent-insert with –skip-concurrent-insert can improve MyISAM performance.

As I said the reason of bad scalability is rw-locks and currently MySQL developers are working on CPU-depended rw-locks implementstation, this will be available in MySQL 5.1 – 5.2

11 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Jay Pipes

Hi Vadim!

Great info. Could you by any chance give us a heads up on what the “tipping point” is where you see scalability issues with concurrent insert? Is there a specific % read/write where MyISAM starts to have trouble, or does the situation normally occur when there is a huge range condition like the one above (20000 rows)?

Cheers!

Jay

Apachez

How does the “concurrent-insert = 2” feature described by Arjen affect the outcome of the above benchmark ?

citrin

Which soft was used in this benchmark?

Vadim

Citrin,

I usually use sysbench (http://sysbench.sf.net).

Jerry

What is the negative impact to turn the concurrent_insert off? Will it make insert waits much longer? Is there any bug or issue related to turn off this default feature?
Will turning off the feature help queries which have no insert on the same table at the same time?

My system has update:Insert:Select ratio is 3:1.5:1 so the db is write more than read.

Thanks.

Marc Pinel

Hi man,

i have concurrent-insert=2 set….how would the positively impact the performance? i have a torrent tracker (legal content ofcourse) with heavy php and mysql visits daily…and some spikes.

Bandara

Hi,

Any one know how to run mySQL from the visual studio 2008. I tried by building the mySQL source code and it worked fine. But problem is how to run it. So if any one can provide step by step procedure its great.

Richard

OK, I’ve never mucked much with this setting, or ever actually, but the stock site I manage is about 170 gig on drive, daily does millions of inserts, updates, selects, and a few 1000 deletes. Some of the larger tables are well over 100,000,000 rows of data, that are part of the daily changes. I have noticed since more and more data is being written, changed, I’m getting slow query issues reading and writing. Do you think if I were to disabled concurrent insert this would help or worsen the select from time issues (the tables are Primary Key index ID,Date, and indexed Date, with the Select statements always:

Select from table where ID = ###### Order by Date

with sometimes

AND Date >= 20100101 and Date <= 20110101 (for ranges of between specific dates)