Do you delete data from the table ?
MyISAM will only grant a write lock when there are no locks on the table -
including implicit read locks. That may be your problem.
There is a single situation when concurrent reads and writes are possible on
MyISAM, however: when your table has no holes in the data. At that point,
selects happen on the existing data, while the insert queue is handled
(sequentially) at the same time.
If that is indeed your problem, you may "fix" the table using OPTIMIZE
Two other options might be:
- set the variable concurrent_insert to 2 - this will allow concurrent
inserts at the end of the table even when there are holes. Downside is that
freed space (from deletes) is not reused.
- use INSERT DELAYED. Code returns immediately, but you have no way of
knowing wether or not any given insert succeeded.
If you delete data, but only relatively old data, you might also benefit
from partitioning the table: I'm not sure about this, but it seems
reasonable that concurrent updates would be possible on partitions with no
holes. Should try this sometime.
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel