LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-23-2010, 06:03 AM   #1
linuxengineer
LQ Newbie
 
Registered: Nov 2010
Posts: 12

Rep: Reputation: 0
Unhappy Postgresql database server


hi,

I am having a postgresql db server. The problem is that the number of idle connections are incresing as time passes. these idle connections are not disconnecting automatically. after a long time these connections will be in large number and the website is not accessible. what is the reason behind this and is there any solution for this without restarting the server or killing the connections manually?
 
Old 11-23-2010, 06:05 AM   #2
linuxengineer
LQ Newbie
 
Registered: Nov 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Also in some occasions while i try to submit data via web page into the database, an error occurs like "error while sending data to the server. Please try again later". this error is not loogged in any of the log files and i also want to know whether this occur due to the large number of idle connections existing in database server ??? If not what can be the reason behind this error ???
 
Old 11-23-2010, 07:16 AM   #3
mfrias
LQ Newbie
 
Registered: Dec 2007
Posts: 15

Rep: Reputation: 7
Quote:
Originally Posted by linuxengineer View Post
hi,

I am having a postgresql db server. The problem is that the number of idle connections are incresing as time passes. these idle connections are not disconnecting automatically. after a long time these connections will be in large number and the website is not accessible. what is the reason behind this and is there any solution for this without restarting the server or killing the connections manually?
In the file "postgresql.conf" there are options "tcp_keepalives_idle", "tcp_keepalives_interval" and "tcp_keepalives_count" you can check the documentation.

You must change sysctl values, this explanation will clarify how to set variables. The above explanation also applies to the file "postgresql.conf".

In slackware (or any gnu/linux) by default have net.ipv4.tcp_keepalive_time = 7200, net.ipv4.tcp_keepalive_probes = 9 and net.ipv4.tcp_keepalive_intvl = 75, then the system will close connections after 7875 seconds or 2.18 hours ( 7200 + ( 9 * 75 )).

Quote:
Originally Posted by linuxengineer View Post
Also in some occasions while i try to submit data via web page into the database, an error occurs like "error while sending data to the server. Please try again later". this error is not loogged in any of the log files and i also want to know whether this occur due to the large number of idle connections existing in database server ??? If not what can be the reason behind this error ???
I think you need to configure the error log, there must be generated if PostgreSQL was blocked by excess connections and otherwise.

The best thing to do is ask the postgresql list.
 
Old 11-28-2010, 10:54 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by linuxengineer View Post
Also in some occasions while i try to submit data via web page into the database, an error occurs like "error while sending data to the server. Please try again later". this error is not loogged in any of the log files and i also want to know whether this occur due to the large number of idle connections existing in database server ??? If not what can be the reason behind this error ???
You're not telling us HOW apache & postgres hang together.

Chances are that you need to look into PHPs settings, and,
maybe, connection pooling on the PHP side.



Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sharing postgresql database manikandan_vs Linux - Newbie 1 10-02-2010 02:30 PM
I need help securing my postgresql database... trist007 Linux - Security 12 01-10-2010 07:38 PM
PostgreSQL database design? justemail Linux - General 1 05-26-2009 08:27 AM
LXer: Database Server With postgresql and pgadmin3 in Ubuntu LXer Syndicated Linux News 0 04-20-2008 01:50 PM
postgresql jdbc database server...????????? Sridhar Guntur Linux - Software 1 10-17-2002 02:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration