pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #18094: max max_connections cannot be set
8+ messages / 4 participants
[nested] [flat]
* BUG #18094: max max_connections cannot be set
@ 2023-09-07 15:56 PG Bug reporting form <noreply@postgresql.org>
2023-09-07 16:07 ` Re: BUG #18094: max max_connections cannot be set David G. Johnston <david.g.johnston@gmail.com>
2023-09-07 16:25 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 8+ messages in thread
From: PG Bug reporting form @ 2023-09-07 15:56 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: nikolay@samokhvalov.com
The following bug has been logged on the website:
Bug reference: 18094
Logged by: Nikolay Samokhvalov
Email address: nikolay@samokhvalov.com
PostgreSQL version: 15.4
Operating system: MacOS
Description:
(apologies for double posting, please disregard the previous message)
Expectation for max max_connections is 262143 in PG14, but it cannot be
achieved:
nik=# select version();
version
---------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 15.4 (Homebrew) on aarch64-apple-darwin22.4.0, compiled by Apple
clang version 14.0.3 (clang-1403.0.22.14.1), 64-bit
(1 row)
nik=# select max_val from pg_settings where name = 'max_connections';
max_val
---------
262143
(1 row)
nik=# alter system set max_connections to 262143;
ERROR: invalid value for parameter "max_connections": 262143
nik=# alter system set max_connections to 262142;
ERROR: invalid value for parameter "max_connections": 262142
nik=# alter system set max_connections to 262140;
ERROR: invalid value for parameter "max_connections": 262140
nik=# alter system set max_connections to 262135;
ERROR: invalid value for parameter "max_connections": 262135
nik=# alter system set max_connections to 262130;
ERROR: invalid value for parameter "max_connections": 262130
nik=# alter system set max_connections to 262100;
ALTER SYSTEM
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #18094: max max_connections cannot be set
2023-09-07 15:56 BUG #18094: max max_connections cannot be set PG Bug reporting form <noreply@postgresql.org>
@ 2023-09-07 16:07 ` David G. Johnston <david.g.johnston@gmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: David G. Johnston @ 2023-09-07 16:07 UTC (permalink / raw)
To: nikolay@samokhvalov.com; pgsql-bugs@lists.postgresql.org
On Thu, Sep 7, 2023 at 9:03 AM PG Bug reporting form <noreply@postgresql.org>
wrote:
> The following bug has been logged on the website:
>
> Bug reference: 18094
> Logged by: Nikolay Samokhvalov
> Email address: nikolay@samokhvalov.com
> PostgreSQL version: 15.4
> Operating system: MacOS
> Description:
>
> (apologies for double posting, please disregard the previous message)
>
> Expectation for max max_connections is 262143 in PG14
>
I don't recall, nor find in the two official places such a thing could
reasonably be listed, there being a number documented as the limit for this.
Partially I suppose because the natural limit, whatever it may be, is
higher than any reasonable choice a DBA might supply.
David J.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #18094: max max_connections cannot be set
2023-09-07 15:56 BUG #18094: max max_connections cannot be set PG Bug reporting form <noreply@postgresql.org>
@ 2023-09-07 16:25 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 04:25 ` Re: BUG #18094: max max_connections cannot be set Nikolay Samokhvalov <nikolay@samokhvalov.com>
1 sibling, 1 reply; 8+ messages in thread
From: Tom Lane @ 2023-09-07 16:25 UTC (permalink / raw)
To: nikolay@samokhvalov.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> Expectation for max max_connections is 262143 in PG14, but it cannot be
> achieved:
Why do you think that's the maximum?
If you are looking at MAX_BACKENDS, that is not a limit on
max_connections. It is a limit on max_connections +
autovacuum_max_workers + 1 + max_worker_processes + max_wal_senders;
cf check_max_connections.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #18094: max max_connections cannot be set
2023-09-07 15:56 BUG #18094: max max_connections cannot be set PG Bug reporting form <noreply@postgresql.org>
2023-09-07 16:25 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
@ 2023-09-08 04:25 ` Nikolay Samokhvalov <nikolay@samokhvalov.com>
2023-09-08 04:55 ` Re: BUG #18094: max max_connections cannot be set David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Nikolay Samokhvalov @ 2023-09-08 04:25 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
nik=# select max_val from pg_settings where name = 'max_connections';
max_val
---------
262143
(1 row)
-- here is why
On Thu, Sep 7, 2023 at 09:25 Tom Lane <tgl@sss.pgh.pa.us> wrote:
> PG Bug reporting form <noreply@postgresql.org> writes:
> > Expectation for max max_connections is 262143 in PG14, but it cannot be
> > achieved:
>
> Why do you think that's the maximum?
>
> If you are looking at MAX_BACKENDS, that is not a limit on
> max_connections. It is a limit on max_connections +
> autovacuum_max_workers + 1 + max_worker_processes + max_wal_senders;
> cf check_max_connections.
>
> regards, tom lane
>
>
>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #18094: max max_connections cannot be set
2023-09-07 15:56 BUG #18094: max max_connections cannot be set PG Bug reporting form <noreply@postgresql.org>
2023-09-07 16:25 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 04:25 ` Re: BUG #18094: max max_connections cannot be set Nikolay Samokhvalov <nikolay@samokhvalov.com>
@ 2023-09-08 04:55 ` David G. Johnston <david.g.johnston@gmail.com>
2023-09-08 13:57 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: David G. Johnston @ 2023-09-08 04:55 UTC (permalink / raw)
To: Nikolay Samokhvalov <nikolay@samokhvalov.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org
On Thu, Sep 7, 2023 at 9:25 PM Nikolay Samokhvalov <nikolay@samokhvalov.com>
wrote:
> nik=# select max_val from pg_settings where name = 'max_connections';
> max_val
> ---------
> 262143
> (1 row)
>
> -- here is why
>
Glossed right over that...yeah, quite a few settings seem to have a max_val
of "unsigned numeric", I'd be curious whether they all have some
non-datatype maximum recognized during runtime that pg_settings is unable
to see.
David J.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #18094: max max_connections cannot be set
2023-09-07 15:56 BUG #18094: max max_connections cannot be set PG Bug reporting form <noreply@postgresql.org>
2023-09-07 16:25 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 04:25 ` Re: BUG #18094: max max_connections cannot be set Nikolay Samokhvalov <nikolay@samokhvalov.com>
2023-09-08 04:55 ` Re: BUG #18094: max max_connections cannot be set David G. Johnston <david.g.johnston@gmail.com>
@ 2023-09-08 13:57 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 14:04 ` Re: BUG #18094: max max_connections cannot be set Nikolay Samokhvalov <nikolay@samokhvalov.com>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2023-09-08 13:57 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Nikolay Samokhvalov <nikolay@samokhvalov.com>; pgsql-bugs@lists.postgresql.org
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Thu, Sep 7, 2023 at 9:25 PM Nikolay Samokhvalov <nikolay@samokhvalov.com>
> wrote:
>> nik=# select max_val from pg_settings where name = 'max_connections';
>> max_val
>> ---------
>> 262143
>> (1 row)
>>
>> -- here is why
> Glossed right over that...yeah, quite a few settings seem to have a max_val
> of "unsigned numeric", I'd be curious whether they all have some
> non-datatype maximum recognized during runtime that pg_settings is unable
> to see.
Yeah, there are for example plenty of entries with max_val of INT_MAX,
but that doesn't necessarily mean you can set them that high. The
max_val is *a* constraint, it's not the *only* constraint.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #18094: max max_connections cannot be set
2023-09-07 15:56 BUG #18094: max max_connections cannot be set PG Bug reporting form <noreply@postgresql.org>
2023-09-07 16:25 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 04:25 ` Re: BUG #18094: max max_connections cannot be set Nikolay Samokhvalov <nikolay@samokhvalov.com>
2023-09-08 04:55 ` Re: BUG #18094: max max_connections cannot be set David G. Johnston <david.g.johnston@gmail.com>
2023-09-08 13:57 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
@ 2023-09-08 14:04 ` Nikolay Samokhvalov <nikolay@samokhvalov.com>
2023-09-08 15:25 ` Re: BUG #18094: max max_connections cannot be set David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Nikolay Samokhvalov @ 2023-09-08 14:04 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; pgsql-bugs@lists.postgresql.org
On Fri, Sep 8, 2023 at 06:57 Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "David G. Johnston" <david.g.johnston@gmail.com> writes:
> > On Thu, Sep 7, 2023 at 9:25 PM Nikolay Samokhvalov <
> nikolay@samokhvalov.com>
> > wrote:
> >> nik=# select max_val from pg_settings where name = 'max_connections';
> >> max_val
> >> ---------
> >> 262143
> >> (1 row)
> >>
> >> -- here is why
>
> > Glossed right over that...yeah, quite a few settings seem to have a
> max_val
> > of "unsigned numeric", I'd be curious whether they all have some
> > non-datatype maximum recognized during runtime that pg_settings is unable
> > to see.
>
> Yeah, there are for example plenty of entries with max_val of INT_MAX,
> but that doesn't necessarily mean you can set them that high. The
> max_val is *a* constraint, it's not the *only* constraint
Thank you for the explanation.
Then, I think, the column name may be misleading to many. I will now
memorize that it's not the actual max value, but I'm sure in a couple of
years I'll forget (as it happens to me often), and think again that this is
a bug.
>
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #18094: max max_connections cannot be set
2023-09-07 15:56 BUG #18094: max max_connections cannot be set PG Bug reporting form <noreply@postgresql.org>
2023-09-07 16:25 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 04:25 ` Re: BUG #18094: max max_connections cannot be set Nikolay Samokhvalov <nikolay@samokhvalov.com>
2023-09-08 04:55 ` Re: BUG #18094: max max_connections cannot be set David G. Johnston <david.g.johnston@gmail.com>
2023-09-08 13:57 ` Re: BUG #18094: max max_connections cannot be set Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 14:04 ` Re: BUG #18094: max max_connections cannot be set Nikolay Samokhvalov <nikolay@samokhvalov.com>
@ 2023-09-08 15:25 ` David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 0 replies; 8+ messages in thread
From: David G. Johnston @ 2023-09-08 15:25 UTC (permalink / raw)
To: Nikolay Samokhvalov <nikolay@samokhvalov.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
On Friday, September 8, 2023, Nikolay Samokhvalov <nikolay@samokhvalov.com>
wrote:
>
>
> On Fri, Sep 8, 2023 at 06:57 Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
>> "David G. Johnston" <david.g.johnston@gmail.com> writes:
>> > On Thu, Sep 7, 2023 at 9:25 PM Nikolay Samokhvalov <
>> nikolay@samokhvalov.com>
>> > wrote:
>> >> nik=# select max_val from pg_settings where name = 'max_connections';
>> >> max_val
>> >> ---------
>> >> 262143
>> >> (1 row)
>> >>
>> >> -- here is why
>>
>> > Glossed right over that...yeah, quite a few settings seem to have a
>> max_val
>> > of "unsigned numeric", I'd be curious whether they all have some
>> > non-datatype maximum recognized during runtime that pg_settings is
>> unable
>> > to see.
>>
>> Yeah, there are for example plenty of entries with max_val of INT_MAX,
>> but that doesn't necessarily mean you can set them that high. The
>> max_val is *a* constraint, it's not the *only* constraint
>
>
> Thank you for the explanation.
>
> Then, I think, the column name may be misleading to many. I will now
> memorize that it's not the actual max value, but I'm sure in a couple of
> years I'll forget (as it happens to me often), and think again that this is
> a bug.
>
Maybe a documentation improvement… but bug or not it doesn’t seem worth the
effort to try too hard here. I already noted that limits based upon data
type size are probably insane to actually approach in reality and getting
an error message at some marginally lower value as in this case might be a
bit surprising but it isn’t at all harmful.
David J.
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2023-09-08 15:25 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07 15:56 BUG #18094: max max_connections cannot be set PG Bug reporting form <noreply@postgresql.org>
2023-09-07 16:07 ` David G. Johnston <david.g.johnston@gmail.com>
2023-09-07 16:25 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 04:25 ` Nikolay Samokhvalov <nikolay@samokhvalov.com>
2023-09-08 04:55 ` David G. Johnston <david.g.johnston@gmail.com>
2023-09-08 13:57 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-09-08 14:04 ` Nikolay Samokhvalov <nikolay@samokhvalov.com>
2023-09-08 15:25 ` David G. Johnston <david.g.johnston@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox