lkananowicz
Monitoring connections pool of Ecto repo
Hi, I am looking for a way to monitor connections pool of Ecto repo. Basically we want to measure maximum capacity of our application, sort of a load/performace testing of app and DB.
We are using Postgres adapter in our application and have defined multiple repos with different pool_size options. Is there an existing library or examples on how to check/count active DB connections in real time? We were considering db_connection behaviour callbacks but just not sure if this is the right direction.
Most Liked
josevalim
Ecto emits telemetry events for every query: Ecto.Repo — Ecto v3.14.0
You can use it to track how long you are awaiting on the queue, the query time, as well as decoding time.
Last Post!
lkananowicz
Thanks, yes, that seems like a very useful solution. I wonder about the case when given query won’t be finished for any reason, like a timeout for example. I guess in that case Telemetry won’t report any events regarding that query?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









