Re: Bug #434: Maximun number of connections - Mailing list pgsql-bugs

From Justin Clift
Subject Re: Bug #434: Maximun number of connections
Date
Msg-id 3B8E7053.F7EC2A29@postgresql.org
Whole thread Raw
In response to Bug #434: Maximun number of connections  (pgsql-bugs@postgresql.org)
List 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@postgresql.org wrote:
>
> Sergio Muscat (sergio@onvol.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/tomcatand when the number of connections exceeds about 30 items, an exception is raised saying  'sorry too many
clientsalready'. 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@postgresql.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

pgsql-bugs by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Majordomo being upgraded ...
Next
From: "Rainer Mager"
Date:
Subject: Re: Re: timestamps cannot be created without time zones