Contention means multiple things are trying to use the same limited resource at the same time.
In this case, the limited resource is:
the SQLite write lockSQLite allows many readers, but only one writer at a time.
So if many goroutines do:
I want to write
I want to write
I want to write
I want to write
they all contend for the same writer slot.
Simple analogy:
One bathroom, many people waitingThe bathroom is SQLite’s writer lock. Only one person can use it. Everyone else waits. If they wait too long, they give up: that is like SQLITE_BUSY.
In Seed:
PutMany wants to write blobs
connect wants to update peers
DomainStore wants to update domain cache
sync wants to update stateAll of them can pile up on the same SQLite writer lock. That pile-up is contention.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime
Powered by Seed HypermediaOpen App