On Tue, 2020-08-18 at 14:53 +0200, Adam Sjøgren wrote: > We have a PostgreSQL 11.3¹ running on an Ubuntu 16.04 server, which > sometimes exhibits a behaviour I can't quite understand: simply logging > into the database starts to take minutes to complete. > > We have 60 processes (workers) running on different machines accessing > the database, that all grab jobs from a queue and update rows in a table > after doing some calculations (which vary in time from <1s to perhaps a > minute, many of them fast). > > Sometimes new database logins slow down, from usually taking <0.05s to > taking minutes. This is for psql as a normal user using Kerberos, for > psql as the postgres superuser, for the web-application logging into the > database, for everything. I would suspect that the problem is with the authentication method. How is authenticatoin configured? I'd "strace" a connection that is hanging in "authenticating" and see what the process does. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com