3 ms·
I did a quick search and it looks like InnoDB implements a spin-lock. Do you see increased CPU utilization when the buffer pool is overloaded? This could explai
by sradman 6y ago
I did a quick search and it looks like InnoDB implements a spin-lock. Do you see increased CPU utilization when the buffer pool is overloaded? This could explain the behavior described in the article.
- jeffbee 6y agoCorrect, it uses an aggressive spinlock without fairness features for waiters like you'd see with a proper production-quality mutex. This makes it very efficient in the absence of contention (i.e. in trivial benchmarks) and extremely poorly behaved in times of contention.
- skyde 6y agoI assumed they would spin for only a short period of time only then fallback to a real lock. This is usually done to avoid blocking the thread before the end of it's time slice if there is a chance the lock would become available. If instead they implement a pure spin loop with sleep I can see why it does not perform well.