Re: Bug #434: Maximun number of connections

From: Justin Clift <justin(at)postgresql(dot)org>
To: sergio(at)onvol(dot)net, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #434: Maximun number of connections
Date: 2001-08-30 16:56:51
Message-ID: 3B8E7053.F7EC2A29@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Sergio,

There is a default value of 32 simulatanous connections in PostgreSQL's
"postgresql.conf" configuration file (in the data directory where your
database is). The parameter name is "max_connections".

It works quite fine if you change this value to be higher than 32, then
restart PostgreSQL. This value can also be altered at compile time to
whatever you want (32 is the default here and thats what gets passed to
the postgresql.conf file).

Hope this helps.

Regards and best wishes,

Justin Clift

pgsql-bugs(at)postgresql(dot)org wrote:
>
> Sergio Muscat (sergio(at)onvol(dot)net) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> Maximun number of connections
>
> Long Description
> What is the maximum number of connections that postgresql can support? I am writing a connection pool using jdbc/tomcat and when the number of connections exceeds about 30 items, an exception is raised saying 'sorry too many clients already'. Is this normal? See below for a dump of the exception.
>
> Regards,
>
> Sergio
>
> Sample Code
> Something unusual has occured to cause the driver to fail. Please report this exception: java.sql.SQLException: Sorry, too many clients already
> at org.postgresql.Driver.connect(Driver.java:125)
> at java.sql.DriverManager.getConnection(DriverManager.java:517)
> at java.sql.DriverManager.getConnection(DriverManager.java:177)
> at odrs.db.DBConnectionPool.<init>(DBConnectionPool.java:54)
> at odrs.db.DBConnectionPool.getDBConnection(DBConnectionPool.java:74)
> at odrs.sql.ClientLoginBean.<init>(ClientLoginBean.java:29)
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Class.java:237)
> at java.beans.Beans.instantiate(Beans.java:207)
> at java.beans.Beans.instantiate(Beans.java:51)
> at jsp._0002fjsp_0002fmainPage_0002ejspmainPage_jsp_0._jspService(_0002fjsp_0002fmainPage_0002ejspmainPage_jsp_0.java:75)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
> at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> at org.apache.tomcat.core.Handler.service(Handler.java:286)
> at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
> at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
> at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> at java.lang.Thread.run(Thread.java:484)
>
> No file was uploaded with this report
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Mikheev, Vadim 2001-08-30 20:25:56 Re: A problem with WAL
Previous Message Marc G. Fournier 2001-08-30 16:25:10 Majordomo being upgraded ...