About Linux FAQ

Browse More FAQs:

Sorry too many clients when trying to connect to PostgreSQL database server - solution

Posted by Vivek Gite [Last updated: April 22, 2006]

Q. I am running PostgreSQL server for my web application and I am getting an error "Sorry too many clients when trying to connect to PostgreSQL". How do I troubleshoot this database error?

A. This error indicates that you have reached the default limit set in your configuration postgresql.conf file. Under FreeBSD default limit is 40 database session. You need to increase this level.

Please note that increasing this level costs about 500 byes of shared memory per connection slot, in addition to costs from shared_buffers and max_locks_per_transaction.

Edit file /usr/local/pgsql/data/postgresql.conf (FreeBSD) or /var/lib/pgsql/data/postgresql.conf (Red Hat Linux) or /etc/postgresql/postgresql.conf (Debian Linux):

# vi /usr/local/pgsql/data/postgresql.conf

Locate parameter max_connections and set new value. For example if you want to 300 database session, it should read as follows:

max_connections = 300

Save the file and restart postgresql server. If you are using FreeBSD restart postgresql with following command:

# /usr/local/etc/rc.d/010.pgsql.sh restart

On the other hand, if you are using Debian Linux, restart postgresql with following command:

# /etc/init.d/postgresql restart

E-mail this to a friend      Printable version

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.