Re: Decrease MAX_BACKENDS to 2^16

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Fetter <david(at)fetter(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Decrease MAX_BACKENDS to 2^16
Date: 2014-04-28 11:37:01
Message-ID: 20140428113701.GA14464@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-04-28 13:32:45 +0300, Heikki Linnakangas wrote:
> On 04/28/2014 12:39 PM, Andres Freund wrote:
> >On 2014-04-28 10:48:30 +0300, Heikki Linnakangas wrote:
> >>On 04/26/2014 09:27 PM, Andres Freund wrote:
> >>>I don't think we need to decide this without benchmarks proving the
> >>>benefits. I basically want to know whether somebody has an actual
> >>>usecase - even if I really, really, can't think of one - of setting
> >>>max_connections even remotely that high. If there's something
> >>>fundamental out there that'd make changing the limit impossible, doing
> >>>benchmarks wouldn't be worthwile.
> >>
> >>It doesn't seem unreasonable to have a database with tens of thousands of
> >>connections. Sure, performance will suffer, but if the connections sit idle
> >>most of the time so that the total load is low, who cares. Sure, you could
> >>use a connection pooler, but it's even better if you don't have to.
> >
> >65k connections will be absolutely *disastrous* for performance because
> >of the big PGPROC et al.
>
> Well, often that's still good enough.

That may be true for 2-4k max_connections, but >65k? That won't even
*run*, not to speak of doing something, in most environments because of
the number of processes required.

Even making only 20k connections will probably crash your computer.

> >The main reason I want to shrink it is that I want to make pin/unpin
> >buffer lockless and all solutions I can come up with for that require
> >flags to be in the same uint32 as the refcount. For performance
> >it'd be beneficial if usagecount also fits in there.
>
> Would it be enough to put only some of the flags in the same uint32?

It's probably possible, but would make things more complicated. For a
"feature" nobody is ever going to use.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marti Raudsepp 2014-04-28 11:44:49 Re: UUIDs in core WAS: 9.4 Proposal: Initdb creates a single table
Previous Message Robert Haas 2014-04-28 11:33:04 Re: So why is EXPLAIN printing only *plan* time?