You might find it helpful to lower query timeouts
<https://www.crunchydata.com/blog/control-runaway-postgres-queries-with-statement-timeout>
in postgres, and move longer running queries to a read replica. This should
increase capacity, and you can catch the errors in application level.

Circuit breakers don't make as much sense at the postgresql level because
there is no good alternative to serve if the database goes down.

On Tue, Feb 14, 2023 at 10:12 AM Tomás Miguez <[email protected]> wrote:

> Hello everyone!
>
> We are currently experiencing some database problems and would like to
> hear your opinions. Our database is sharded, and occasionally, one of the
> shards becomes inaccessible. When a service attempts to access it, a
> timeout exception is eventually raised. This can cause a service clog since
> the timeout takes some time to occur. We have found a solution for a
> similar issue with Redis by activating the circuit breaker functionality of
> the Redis' gem. Would it be advisable to implement a circuit breaker, or
> would a different approach be more suitable? Has there been any discussion
> about including it as part of the Sequel gem's functionality?
>
> Many thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "sequel-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sequel-talk/1bc9baad-7543-43d3-b3ec-ec377b4f30cen%40googlegroups.com
> <https://groups.google.com/d/msgid/sequel-talk/1bc9baad-7543-43d3-b3ec-ec377b4f30cen%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CAGrnogg2OCFzv8rpexgMi6sc2CYe%3DDumio1tO7-1k5Ui8dOuCA%40mail.gmail.com.

Reply via email to