Hi all,

Good news. :-)

On Thu, Aug 20, 2020 at 6:36 PM Esteban Maringolo <emaring...@gmail.com> wrote:

> > Is it not so that in Docker all network connections in/out/between 
> > instances are mediated by some management software ?
> > I even thought it was nginx. Maybe I am totally wrong here.
>
> No, it is not that, but inside a Swarm all containers run in a
> "overlay network" (basically a VPN) that is independent of the host
> network, this way you can distribute containers among different hosts.

> All the packages are routed by Docker itself, and apparently there is
> an issue there, that if a connection is idle for a certain time, it
> silently stops routing packages, leaving both sides of the connection
> unaware of it.

I finally was able to pinpoint what was causing this issue that gave
me a lot of headaches.

It effectively was the "overlay network" [1] of my Docker Swarm [2]
deployment. The "mesh" router was terminating idle connections after
10 minutes (I noticed this exact timing some days ago).

So configuring the PostgreSQL server container to use the host network
instead of the overlay made all my connections stable again. No more
silent drops. No more GlorpDatabaseReadError. And now with some
additional health checks in place that will help me when there is an
actual issue with the connections.

Maybe there is another way to make it work within the overlay, but
that's not something I'm interested in doing right now.

So P3 behavior was okay (again), PostgreSQL was not doing anything odd
either, it was what was sitting in between.

Best regards,

[1] https://docs.docker.com/network/overlay/
[2] I have a Swarm with 1 nginx for static content, 1 PostgreSQL and 1
Traefik as an HTTP gateway for several replicas of a Seaside
application.

Reply via email to