Обсуждение: Max connections

Поиск
Список
Период
Сортировка

Max connections

От
"Benjamin Krajmalnik"
Дата:

I am setting up a test environment to simulate a very high load.  We have a server farm which is receiving data (cold be thousands of simultaneous users posting data).  I currently have max_connections set to 500 and the server is starting ok.  If I try to increase the max_connections to 1000, the server is unable to start.  I am running a VM with 4GB RAM.  Swap space is not being used, and the system is showing about 1.5GB of ram not being utilized.

Are there any other config setting which should be changed together with max_connections to successfully start the postmaster?

Re: Max connections

От
Shoaib Mir
Дата:
On Tue, Aug 11, 2009 at 3:42 PM, Benjamin Krajmalnik <kraj@illumen.com> wrote:

I am setting up a test environment to simulate a very high load.  We have a server farm which is receiving data (cold be thousands of simultaneous users posting data).  I currently have max_connections set to 500 and the server is starting ok.  If I try to increase the max_connections to 1000, the server is unable to start.  I am running a VM with 4GB RAM.  Swap space is not being used, and the system is showing about 1.5GB of ram not being utilized.

Are there any other config setting which should be changed together with max_connections to successfully start the postmaster?


Increasing max_connection will make PostgreSQL to request more System V shared memory or semaphores than your operating system's default configuration allow. Did you tune/tweak the kernel options for that? Details for those options can be found at

http://www.postgresql.org/docs/8.3/static/kernel-resources.html#SYSVIPC

--
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: Max connections

От
"Benjamin Krajmalnik"
Дата:

Yes, I had, but apparently the values were not high enough to accommodate that many connections.

I retuned the IPC kernel setting, and now it appears to be running fine.

Thanks.

 

 

From: Shoaib Mir [mailto:shoaibmir@gmail.com]
Sent: Monday, August 10, 2009 11:51 PM
To: Benjamin Krajmalnik
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Max connections

 

On Tue, Aug 11, 2009 at 3:42 PM, Benjamin Krajmalnik <kraj@illumen.com> wrote:

I am setting up a test environment to simulate a very high load.  We have a server farm which is receiving data (cold be thousands of simultaneous users posting data).  I currently have max_connections set to 500 and the server is starting ok.  If I try to increase the max_connections to 1000, the server is unable to start.  I am running a VM with 4GB RAM.  Swap space is not being used, and the system is showing about 1.5GB of ram not being utilized.

Are there any other config setting which should be changed together with max_connections to successfully start the postmaster?


Increasing max_connection will make PostgreSQL to request more System V shared memory or semaphores than your operating system's default configuration allow. Did you tune/tweak the kernel options for that? Details for those options can be found at

http://www.postgresql.org/docs/8.3/static/kernel-resources.html#SYSVIPC

--
Shoaib Mir
http://shoaibmir.wordpress.com/

Re: Max connections

От
Tom Lane
Дата:
"Benjamin Krajmalnik" <kraj@illumen.com> writes:
> I am setting up a test environment to simulate a very high load.  We
> have a server farm which is receiving data (cold be thousands of
> simultaneous users posting data).  I currently have max_connections set
> to 500 and the server is starting ok.  If I try to increase the
> max_connections to 1000, the server is unable to start.  I am running a
> VM with 4GB RAM.  Swap space is not being used, and the system is
> showing about 1.5GB of ram not being utilized.

Quite honestly, you're living in fantasy land if you expect to support
1000 concurrently active backends on such a restricted server.  Get
yourself a connection pooler and knock down max_connections to 100 or
so.

            regards, tom lane

Re: Max connections

От
"Benjamin Krajmalnik"
Дата:
Tom,

This exercise is exactly to help us size our production server, but I
appreciate what you are saying.
I am using pgbouncer, but my understanding is that I need to make as
many potential connections available on the server side as the maximum
pool size - I will shoot them an email to get some guidance.

As always, thank you so much for your assistance.


> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Tuesday, August 11, 2009 7:54 AM
> To: Benjamin Krajmalnik
> Cc: pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] Max connections
>
> "Benjamin Krajmalnik" <kraj@illumen.com> writes:
> > I am setting up a test environment to simulate a very high load.  We
> > have a server farm which is receiving data (cold be thousands of
> > simultaneous users posting data).  I currently have max_connections
> set
> > to 500 and the server is starting ok.  If I try to increase the
> > max_connections to 1000, the server is unable to start.  I am
running
> a
> > VM with 4GB RAM.  Swap space is not being used, and the system is
> > showing about 1.5GB of ram not being utilized.
>
> Quite honestly, you're living in fantasy land if you expect to support
> 1000 concurrently active backends on such a restricted server.  Get
> yourself a connection pooler and knock down max_connections to 100 or
> so.
>
>             regards, tom lane