Around 19% of time spent in write queries is being spent locking or waiting for locking on primary database. This is a scalability bottleneck (we can buy more replicas, we can't buy more primary databases for a section),
Maybe these traces can be adjusted? I could think of multiple ways:
- Reduce the timeout, it's 15 seconds in some cases
- Build and use a dedicated lock manager? We have one for files but I don't know how it's used post redis.
- Use PoolCounter instead.
- Use x2/main stash in some cases