<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I debug the following error org.postgresql.util.PSQLException. message: FATAL: connection limit exceeded for non-superusers? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324446#M11447</link>
    <description>&lt;P&gt;You can check your connections using this request:
select * from pg_stat_activity;&lt;/P&gt;
&lt;P&gt;To fix it you could:
Change your max_connections entry in postgresql.conf&lt;/P&gt;
&lt;P&gt;Check also this:
&lt;A href="http://www.postgresql.org/docs/current/static/kernel-resources.html" target="test_blank"&gt;http://www.postgresql.org/docs/current/static/kernel-resources.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;For the above query and the postgresql.conf location you can use the pgadmin tool. Don't forget to restart the server to make your changes active.&lt;/P&gt;
&lt;P&gt;You could check out this connection poller:
&lt;A href="http://pgfoundry.org/projects/pgbouncer" target="test_blank"&gt;http://pgfoundry.org/projects/pgbouncer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;NOTE: for this kind of issues it would be helpful if you provided your exact postgresql version and any custom configuration you provided, as there might already be an answer here:
&lt;A href="http://doc.nuxeo.com/x/fwQz"&gt;Configuring Postgresq for Nuxeo&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2012 17:05:49 GMT</pubDate>
    <dc:creator>Wojciech_Sulejm</dc:creator>
    <dc:date>2012-02-09T17:05:49Z</dc:date>
    <item>
      <title>How do I debug the following error org.postgresql.util.PSQLException. message: FATAL: connection limit exceeded for non-superusers?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324443#M11444</link>
      <description>&lt;P&gt;Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.AbstractBatcher.prepareSelectStatement(AbstractBatcher.java:145)
at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:96)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:646)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:620)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:624)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
... 14 more
Caused by: org.postgresql.util.PSQLException: FATAL: connection limit exceeded for non-superusers
at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:469)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:112)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:16:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324443#M11444</guid>
      <dc:creator>Mariana_Cedica</dc:creator>
      <dc:date>2012-02-09T16:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I debug the following error org.postgresql.util.PSQLException. message: FATAL: connection limit exceeded for non-superusers?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324444#M11445</link>
      <description>&lt;P&gt;You've got in trouble with the database connections. That's mean that you should start to monitor the connection pools of your server. This is do-able by just adding a new bundle in your runtime &lt;A href="http://doc.nuxeo.com/x/QQA7"&gt;nuxeo-core-management-jtajca&lt;/A&gt; and activate the remote JMX monitoring in your nuxeo.conf.&lt;/P&gt;
&lt;P&gt;Once the bundle is installed, you should inspect the following resources using your JMX browser :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Catalina:class=javax.sql.DataSource,name="jdbc/nuxeo",type=DataSource&lt;/LI&gt;
&lt;LI&gt;org.nuxeo:name=ConnectionMonitoring,type=service&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;As an example, using the command line tool &lt;A href="http://doc.nuxeo.com/x/QQA7"&gt;jmx term&lt;/A&gt;, the following command will figure out how much connections is currently used by your server.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;$ java -jar jmxterm-1.0-alpha-4-uber.jar -l localhost:1089 -n &amp;lt;&amp;lt;!
bean Catalina:class=javax.sql.DataSource,name="jdbc/nuxeo",type=DataSource
get numActive
get numIdle
get maxActive
get maxIdle
bean org.nuxeo:name=ConnectionMonitoring,type=service
get ConnectionCount
get IdleConnectionCount
get PartitionCount
get PartitionMaxSize
!
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The ouput will be something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;#bean is set to Catalina:class=javax.sql.DataSource,name="jdbc/nuxeo",type=DataSource
#mbean = Catalina:class=javax.sql.DataSource,name="jdbc/nuxeo",type=DataSource:
numActive = 0;

#mbean = Catalina:class=javax.sql.DataSource,name="jdbc/nuxeo",type=DataSource:
maxActive = 100;

#mbean = Catalina:class=javax.sql.DataSource,name="jdbc/nuxeo",type=DataSource:
numIdle = 1;

#bean is set to org.nuxeo:name=ConnectionMonitoring,type=service
#mbean = org.nuxeo:name=ConnectionMonitoring,type=service:
ConnectionCount = 1;

#mbean = org.nuxeo:name=ConnectionMonitoring,type=service:
IdleConnectionCount = 1;

#mbean = org.nuxeo:name=ConnectionMonitoring,type=service:
PartitionCount = 1;

#mbean = org.nuxeo:name=ConnectionMonitoring,type=service:
PartitionMaxSize = 20;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;By summing all the counters, we see that our server is currently using 3 connections at all. Also, we know now that the maximum connection our server may open is 120.&lt;/P&gt;
&lt;P&gt;Looking deeper in the stack trace, we can see that the error comes from the database itself. That means that you've configured your app server for more connections than what it's available on the database.&lt;/P&gt;
&lt;P&gt;You can check what is configured on your database server by executing the following command line :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;$ /usr/local/bin/check_postgres.pl --warning='80%' --critical='90%' \
  -H localhost -p 5433 --action=backends --dbname=nuxeo \
  --dbuser=monitor --dbpass=monitor://nx
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output will be something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; 3 of 100 connections (3%) | time=0.08  'nuxeo'=5;80;90;0;100 \
 'postgres'=0;80;90;0;100 'template0'=0;80;90;0;100 'template1'=0;80;90;0;100
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, there is a mismatch of 20 connections. You should always allocate more connection on your database server than what you're using on your app server.&lt;/P&gt;
&lt;P&gt;As this stage, you have two options :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;reconfigure nuxeo for using less connections, just read the  &lt;A href="http://doc.nuxeo.com/x/QQA7"&gt;nuxeo configuration parameters&lt;/A&gt; documentation for the pools.&lt;/LI&gt;
&lt;LI&gt;allocate more connections on your postgresql server (I let you investigate this option by reading the &lt;A href="http://www.postgresql.org/docs/9.1/static/admin.html"&gt;postgresql administration documentation&lt;/A&gt;).&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:51:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324444#M11445</guid>
      <dc:creator>slacoin_Lacoin</dc:creator>
      <dc:date>2012-02-09T16:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I debug the following error org.postgresql.util.PSQLException. message: FATAL: connection limit exceeded for non-superusers?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324445#M11446</link>
      <description>&lt;P&gt;That means you have reached the configured maximum number of concurrent connections to your PostgreSQL, see &lt;A href="http://www.postgresql.org/docs/9.1/static/runtime-config-connection.html#GUC-MAX-CONNECTIONS"&gt;max_connections postgres parameter&lt;/A&gt;.&lt;BR /&gt;
You can see the currently opened connections with &lt;CODE&gt;select * from pg_stat_activity;&lt;/CODE&gt; or &lt;CODE&gt;netstat -an|grep 5432&lt;/CODE&gt; (assuming your postgres is using port 5432)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:59:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324445#M11446</guid>
      <dc:creator>Julien_Carsique</dc:creator>
      <dc:date>2012-02-09T16:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I debug the following error org.postgresql.util.PSQLException. message: FATAL: connection limit exceeded for non-superusers?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324446#M11447</link>
      <description>&lt;P&gt;You can check your connections using this request:
select * from pg_stat_activity;&lt;/P&gt;
&lt;P&gt;To fix it you could:
Change your max_connections entry in postgresql.conf&lt;/P&gt;
&lt;P&gt;Check also this:
&lt;A href="http://www.postgresql.org/docs/current/static/kernel-resources.html" target="test_blank"&gt;http://www.postgresql.org/docs/current/static/kernel-resources.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;For the above query and the postgresql.conf location you can use the pgadmin tool. Don't forget to restart the server to make your changes active.&lt;/P&gt;
&lt;P&gt;You could check out this connection poller:
&lt;A href="http://pgfoundry.org/projects/pgbouncer" target="test_blank"&gt;http://pgfoundry.org/projects/pgbouncer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;NOTE: for this kind of issues it would be helpful if you provided your exact postgresql version and any custom configuration you provided, as there might already be an answer here:
&lt;A href="http://doc.nuxeo.com/x/fwQz"&gt;Configuring Postgresq for Nuxeo&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2012 17:05:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-do-i-debug-the-following-error-org-postgresql-util/m-p/324446#M11447</guid>
      <dc:creator>Wojciech_Sulejm</dc:creator>
      <dc:date>2012-02-09T17:05:49Z</dc:date>
    </item>
  </channel>
</rss>

