Today I was working with the client loading data to MyISAM tables at very high rate. Hundreds of millions rows are loaded daily into single MySQL instance with bursts up to 100K of records/sec which need to be inserted (in the table with few indexes). It was good not all records had to go to the same table and so in theory using multiple thread to do inserts in multiple tables would not be bound by table locks and would be able to use multiple cores efficiently to get good insert rate... or so it seemed.
In reality inserting in parallel into different tables when
indexes fit in memory results in very bad contention causing
hundreds of thousands of context switches per second with far
less work done than one would hope. As we already discussed
MyISAM key cache has serious mutex contention issue as there is
global …