Strange connection limit problem

From: Ict Security <ict(dot)security(dot)job(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Strange connection limit problem
Date: 2019-06-07 11:58:04
Message-ID: CACd6LfZPk2HAk502WJuxBO8pzvqbr6PrSwrVqB1ruu_D=4de-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear guys,

i have two identical Postgresql 9.6.1 and i need, to test an
application, to reach connection above 1024.

I setup 2400 as max_connections
I raised file-max kernel limit to 65535
I increased shared_buffers
I also increased the value in semaphores in both
And i added this in limits.conf:
* - nofile 999999

But - and it is really strange - in machine nr. 1 i can start
thousands of connections while in machine nr. 2 after 1024 connections
Postgres does not accept anything else.

Configuration are the same on the two machines:

ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 63462
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 999999
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 999999
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

ipcs -l
------ Messages Limits --------
max queues system wide = 8192
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 18014398509465599
max total shared memory (kbytes) = 18014398442373116
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 8192
max semaphores per array = 4096
max semaphores system wide = 25600000
max ops per semop call = 64
semaphore max value = 32767

ONLY here i can notice a different:
- machine nr. 1
cat /proc/14994/limit (where 14994 is Postgres' PID):
Max open files 1024 4096 files

- machine nr. 2
cat /proc/8459/limits (where 8459 is Postgres' PID)
Max open files 999999 999999 files

Maybe '999999' is an out of range value and it is not considered?
In this case, how can i solve?

Thank you!
Frank

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Verite 2019-06-07 12:02:37 Re: delimeters psql /CSV
Previous Message Ron 2019-06-07 11:24:45 Re: delimeters psql /CSV