Re: Add GUC to tune glibc's malloc implementation.

From: Ronan Dunklau <ronan(dot)dunklau(at)aiven(dot)io>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, tomas(dot)vondra(at)enterprisedb(dot)com
Subject: Re: Add GUC to tune glibc's malloc implementation.
Date: 2023-06-22 14:02:06
Message-ID: 3686246.MHq7AAxBmi@aivenlaptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le jeudi 22 juin 2023, 15:49:36 CEST Tom Lane a écrit :
> This seems like a pretty awful idea, mainly because there's no way
> to have such a GUC mean anything on non-glibc platforms, which is
> going to cause confusion or worse.

I named the GUC glibc_malloc_max_trim_threshold, I hope this is enough to
clear up the confusion. We already have at least event_source, which is
windows specific even if it's not clear from the name.

>
> Aren't these same settings controllable via environment variables?
> I could see adding some docs suggesting that you set thus-and-such
> values in the postmaster's startup script. Admittedly, the confusion
> argument is perhaps still raisable; but we have a similar docs section
> discussing controlling Linux OOM behavior, and I've not heard much
> complaints about that.

Yes they are, but controlling them via an environment variable for the whole
cluster defeats the point: different backends have different workloads, and
being able to make sure for example the OLAP user is memory-greedy while the
OLTP one is as conservative as possible is a worthwile goal. Or even a
specific backend may want to raise it's work_mem and adapt glibc behaviour
accordingly, then get back to being conservative with memory until the next
such transaction.

Regards,

--
Ronan Dunklau

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2023-06-22 14:03:41 Re: bgwriter doesn't flush WAL stats
Previous Message Tom Lane 2023-06-22 13:49:36 Re: Add GUC to tune glibc's malloc implementation.