wfgilman

wfgilman

Intermittent DB Timeout Errors from Postgrex on AWS RDS

My logs are showing intermittent timeout errors for queries that are normally really quick (milliseconds). They are just SELECT queries for ~10 records.

DBConnection.Connection: 20:52:25.688 [error] Postgrex.Protocol (#PID<0.2258.0>) 
disconnected: ** (DBConnection.ConnectionError) client #PID<0.2502.0> timed out because 
it checked out the connection for longer than 15000ms 

Has anyone experienced this? Some thoughts that come to mind:

  1. Connectivity of RDS
  2. Records are being locked by another process

Would appreciate any commentary here. I’m not sure how to go about debugging this. I read all the threads about passing extended timeouts to the DB, but that doesn’t seem necessary since I don’t have any ecto queries that run over 1s.

Marked As Solved

wfgilman

wfgilman

To close the loop on this, I’m almost 100% certain that the timeout errors were due to the DB connection pool being maxed out due to multiple instances of my application being started by my autoscaling parameters.

Also Liked

OvermindDL1

OvermindDL1

Heh, I mean on the PostgreSQL Server itself, I’m pretty sure this will be standard SQL server debugging rather than anything Elixir specific (though it’s possible, I find it highly unlikely). :slight_smile:

byungjikroh

byungjikroh

I have same problem. Not slow query takes too much time more than timeout setting.

I haven’t solved this problem and not found out a hint to solve.

Where Next?

Popular in Questions Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Lily
In templates/appointment/index.html.eex: &lt;%= for appointment &lt;- @appointments do %&gt; &lt;tr&gt; &lt;td&gt;&lt;%= appoi...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

We're in Beta

About us Mission Statement