Re: Let's make PostgreSQL multi-threaded - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Let's make PostgreSQL multi-threaded
Date
Msg-id CAMT0RQSR1EPNRhexzijhR0KTcAx1T+YwcTWb+K8e7xSy-Rmz3A@mail.gmail.com
Whole thread Raw
In response to Re: Let's make PostgreSQL multi-threaded  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Let's make PostgreSQL multi-threaded
List pgsql-hackers
On Tue, Jun 13, 2023 at 9:55 AM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> At Tue, 13 Jun 2023 09:55:36 +0300, Konstantin Knizhnik <knizhnik@garret.ru> wrote in
> > Postgres backend is "thick" not because of large number of local
> > variables.
> > It is because of local caches: catalog cache, relation cache, prepared
> > statements cache,...
> > If they are not rewritten, then backend still may consume a lot of
> > memory even if it will be thread rather then process.
> > But threads simplify development of global caches, although it can be
> > done with DSM.
>
> With the process model, that local stuff are flushed out upon
> reconnection. If we switch to the thread model, we will need an
> expiration mechanism for those stuff.

The part that can not be so easily solved is that "the local stuff"
can include some leakage that is not directly controlled by us.

I remember a few times when memory leaks in some PostGIS packages
cause slow memory exhaustion and the simple fix was limiting
connection lifetime to something between 15 min and an hour.

The main problem here is that PostGIS uses a few tens of other GPL GIS
related packages which are all changing independently and thus it is
quite hard to be sure that none of these have developed a leak. And
you also likely can not just stop upgrading these as they also contain
security fixes.

I have no idea what the fix could be in case of threaded server.



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] Missing dep on Catalog.pm in meson rules
Next
From: Andres Freund
Date:
Subject: Re: trying again to get incremental backup