Instrument a number of DB calls done as part of request and worker
In order to introduce changes as Make Sidekiq to use read-only replicas we need to better understand how many calls we do fire to DB, and whether they are read-only or read-write types.
I think we could add:
-
db_readonly_calls: allSELECTs? -
db_readwrite_calls: as they create a sticky connection, all that is notSELECT? -
db_cached_calls: they are still expensive on Rails side to instantiate the objects
And, ideally add it for sidekiq and puma/unicorn. That way we could really see all requests/jobs that perform DB ops, and what kind of ops they do.
Edited by Nikola Milojevic