I read the definition in the docs
https://hexdocs.pm/db_connection/DBConnection.html#start_link/2-queue-config
But I am confused as to what they mean and how do they work. The example given is confusing. Can someone explain me this?
I read the definition in the docs
https://hexdocs.pm/db_connection/DBConnection.html#start_link/2-queue-config
But I am confused as to what they mean and how do they work. The example given is confusing. Can someone explain me this?
This answer I wrote a while ago might help you.
This is an extremely late reply but would like to provide my own answer in case someone visits.
See timeout - Elixir: DBConnection queue_target and queue_interval explained - Stack Overflow
The timeouts you’re referring to are set with the
:timeoutoption in execution functions (i.e.execute/4),:queue_targetand:queue_intervalare only meant to affect the pool’s ability to begin new requests (for requests to checkout connections from the pool), not requests that have already checked out connections and are already being processed.
Keep in mind that all attempts to checkout connections during a
:queue_intervalmust take longer than:queue_targetin order for these values to affect anything. Normally you’d test different values and monitor your database’s ability to keep up in order to find optimal values for your environment.