Re: PostgreSQL Connections?

From: Shane Ambler <pgsql(at)007Marketing(dot)com>
To: Ashish Karalkar <ashish_karalkar(at)yahoo(dot)com>
Cc: Shoaib Mir <shoaibmir(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL Connections?
Date: 2007-01-13 08:34:40
Message-ID: 45A899A0.60908@007Marketing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ashish Karalkar wrote:
> Hi Shoaib
>
> Following is the output for ps auxwww | grep ^postgres
>
> IP address of my server is 172.18.5.155

> postgres 12846 0.0 0.8 45328 4164 ? Ss
> Jan12 0:00 postgres: qsweb qsweb06jan07
> 172.18.4.61(4272) idle

> postgres 23335 0.0 0.9 45336 4800 ? Ss
> 11:38 0:00 postgres: qsweb postgres
> 172.18.4.16(1313) idle

> postgres 23665 0.0 0.8 45204 4260 ? Ss
> 12:13 0:00 postgres: qsweb qsweb12jan2007
> 172.18.5.197(4799) idle

> postgres 23753 0.0 1.0 45336 5216 ? Ss
> 12:18 0:00 postgres: qsweb postgres
> 172.18.4.58(1140) idle

> postgres 23761 0.0 1.0 45336 5216 ? Ss
> 12:20 0:00 postgres: qsweb postgres
> 172.18.4.135(1214) idle

> postgres 23868 0.0 0.8 45204 4260 ? Ss
> 12:30 0:00 postgres: qsweb qsweb12jan2007
> 172.18.5.155(37415) idle

Will probably need a bit more information here but what I can figure is-

You say you have a server and a single client - there are at least 6
different ip addresses in the process list you sent.

With the multiple client connections from other machines - one is
obviously the ip address that you know you are using, can you account
for the others?
If not then you should be fixing your security settings - either in your
pg_hba.conf or a firewall on the server.

From the multiple connections from your server IP I would guess that
you are running a web server and using persistent connections of some
sort. This will keep each connection open so the next page request
doesn't have the overhead of establishing a new connection. The ones
that say idle in transaction would be linked to a page being
constructed. The idle ones will be waiting for the next page request.
This is not a bad thing, although some methods of achieving this are
better than others.

What client software are you using on your client machine?

Does this program exit normally or is it crashing before it closes the
connection it has established?

Does the one program open more than one connection when it is running?

Was this list taken while the client program was running?

>
> --- Shoaib Mir <shoaibmir(at)gmail(dot)com> wrote:
>
>> Can you show us the output for:
>>
>> ps auxwww | grep ^postgres
>>
>> that should explain a little more...
>>
>> -------------
>> Shoaib Mir
>> EnterpriseDB (www.enterprisedb.com)
>>
>> On 1/10/07, Ashish Karalkar
>> <ashish_karalkar(at)yahoo(dot)com> wrote:
>>> Hello All,
>>> I am running PostgresSQL 8.2 on Redhat Linux 4.
>>> When I look for the processes that are using
>> postgres
>>> using ps aux|more
>>> I got lots of Idle processes with servers own IP
>>> address. Can anybody please tell me why this is
>>> happening.
>>>
>>> Also there are multiple processes for my single
>>> client(same IP) of which maximum are idle. are
>> these
>>> processes means connection or there is a single
>>> connection starting many processes.
>>>

--

Shane Ambler
pgSQL(at)007Marketing(dot)com

Get Sheeky @ http://Sheeky.Biz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Philippe Lang 2007-01-13 08:43:16 XEON familiy 5000, 5100 or 5300?
Previous Message Marcel Gsteiger 2007-01-13 08:33:46 Problems with unique restrictions