Base solution for your next web application
Open Closed

Postgres - connections not getting closed, PostgresException 53300 #11764


User avatar
0
ips-ad created

Hi,

Lately I was observing that our app server (Zero 8.1, .net Core) was occupying up to the limit of 100 db sessions/connections. So when I opened like PgAdmin, that resulted in PostgresException 53300, because the default pool config is also 100 connections. Yes, there was some more load on the app server than usual, but I'm observing that almost all sessions are in "idle" state with "Wait Event" "Client: ClientRead", "COMMIT" being the last SQL statement I guess. And "Last state changed at" is way more than 300 seconds for most of the sessions, many of them were several days old (300 seconds should be the default "Connection Idle Lifetime" from Postgres):

I don't think that this is normal behavior, or is it..? I also tested with Zero 12.1, it seems to behave the same and initiates a couple of sessions directly after startup. Those remain in the same idle state, too.

Thanks upfront!


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ips-ad

    We faced a similar problem under a high load in previous versions but it was resolved in ABP framework. Is it possible for you to test this with a brand new 12.4.2 version ?

    Thanks,

  • User Avatar
    0
    ips-ad created

    Hi, Thanks for this information. Updating will take a while - just to confirm, 12.4.2 contains a fix regarding idle connections that 12.1.0 doesn't contain? Because 12.1.0 also had idle connections "ClientRead" older than 300 seconds, even shortly after startup and without any load at all. Those should get closed too, right?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ips-ad

    The problem was fixed in ABP Nuget packages, not in AspNet Zero itself. So, if you can upgrade your Abp NuGet packages, it should be enouhg.

    By the way, could you also share your Startup.cs code with me of the related web project ?

  • User Avatar
    0
    ips-ad created

    Hi, I can finally confirm that with upgrading to Zero 12.4.2 these old sessions are being cleared.