Mojo::Pg and db connection exhaustion

78 views
Skip to first unread message

Neil Watson

unread,
Sep 11, 2015, 11:32:21 AM9/11/15
to mojol...@googlegroups.com
Greetings,

After starting to use mojo::pg I'm getting these errors after some
running time:

failed: FATAL: remaining connection slots are reserved for
non-replication superuser connections at ../perl5/lib/perl5/Mojo/Pg.pm
line 83.

I assume the cached db connections are not being recycled. How do I fix
this?

--
Neil Watson
Linux/UNIX Consultant
http://watson-wilson.ca

sri

unread,
Sep 11, 2015, 11:38:05 AM9/11/15
to Mojolicious, ne...@watson-wilson.ca
Only 5 connections are cached by default, which should rarely be a problem.


You're prolly just leaking connections in your code, which should be easy to figure out with Devel::Cycle and friends.

--
sebastian

Neil Watson

unread,
Sep 11, 2015, 3:44:46 PM9/11/15
to Mojolicious
On Fri, Sep 11, 2015 at 08:38:04AM -0700, sri wrote:
>
>     http://mojolicio.us/perldoc/Mojo/Pg#max_connections
> You're prolly just leaking connections in your code, which should be
> easy to figure out with Devel::Cycle and friends.

When I was using straight DBI I never had an explicit disconnects. It
just worked. :(

sri

unread,
Sep 11, 2015, 4:26:27 PM9/11/15
to Mojolicious, ne...@watson-wilson.ca
When I was using straight DBI I never had an explicit disconnects. It
just worked. :(

You might be misunderstanding something here. There's only more than one connection if you're performing queries non-blocking, and i very much doubt you've done that with raw DBI. If all you're doing is blocking queries, then there will never be more than one connection.

--
sebastian 
Reply all
Reply to author
Forward
0 new messages