Re: Limit on connections

Lists: pgsql-cygwin
From: "Colin Mangiagalli" <colin(at)camara(dot)co(dot)za>
To: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Limit on connections
Date: 2003-02-24 13:54:14
Message-ID: 002101c2dc0c$3a2ad8c0$7201a8c0@camara.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Hi

Is there a limit under postgresql/cygwin/windows to the maximum number
of connections you can make to the database.

I am using PostgreSQL 7.2.1-2 and Poolman 2.1-b1 to managed the
connections

I had this weird problem that there were about 35 connections open
(looking at the windows task manager), all doing
something (what I don't know) and the CPU usage was sitting at 100%

I have seen this problem twice before, but don't know how to replicate
it. Also, I have to actaully restart the machine in
order to close these connections, because the postmaster service won't
shut down.
What does that mean if the connections don't want to close normally?

Is there a way to see what could have opened the connections?

Thanks
Colin


From: Jason Tishler <jason(at)tishler(dot)net>
To: Colin Mangiagalli <colin(at)camara(dot)co(dot)za>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Limit on connections
Date: 2003-02-25 12:26:24
Message-ID: 20030225122624.GD1876@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Colin,

On Mon, Feb 24, 2003 at 03:54:14PM +0200, Colin Mangiagalli wrote:
> Is there a limit under postgresql/cygwin/windows to the maximum number
> of connections you can make to the database.

Yes, Cygwin has a limit of ~63 children per process (due to Cygwin's
fork() implementation). Hence, Cygwin PostgreSQL will have a similar
limit to the maximum number of database connections.

> I had this weird problem that there were about 35 connections open
> (looking at the windows task manager), all doing something (what I
> don't know) and the CPU usage was sitting at 100%

Time to debug. Attach via gdb or strace to determine what the spinners
are doing.

> What does that mean if the connections don't want to close normally?

Switch to Linux? :,)

> Is there a way to see what could have opened the connections?

Try the following:

http://www.sysinternals.com/ntw2k/source/tcpview.shtml

or one of the other great tools from Sysinternals.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: "Colin Mangiagalli" <colin(at)camara(dot)co(dot)za>
To: "'Jason Tishler'" <jason(at)tishler(dot)net>
Cc: <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: Limit on connections
Date: 2003-02-25 13:05:33
Message-ID: 001101c2dcce$94e192a0$7201a8c0@camara.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Thanks Jason

Just to let you know. I finally solved the Permission Denied problem
when the database was trying to
write to the transaction logs.

It was because of a nightly backup they were running on the machine. I
had asked them many times about
their tape backup system, but they told me they weren't backing up that
machine. Turns out they were.
I finally got a look at the backup logs and saw that every time the
machine went down, what was it doing,
the backup!

So now I scheduled pg_dump to run every night and they just back up the
one file. The machine is still up :-)

-----Original Message-----
From: Jason Tishler [mailto:jason(at)tishler(dot)net]
Sent: 25 February 2003 02:26
To: Colin Mangiagalli
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: [CYGWIN] Limit on connections

Colin,

On Mon, Feb 24, 2003 at 03:54:14PM +0200, Colin Mangiagalli wrote:
> Is there a limit under postgresql/cygwin/windows to the maximum number

> of connections you can make to the database.

Yes, Cygwin has a limit of ~63 children per process (due to Cygwin's
fork() implementation). Hence, Cygwin PostgreSQL will have a similar
limit to the maximum number of database connections.

> I had this weird problem that there were about 35 connections open
> (looking at the windows task manager), all doing something (what I
> don't know) and the CPU usage was sitting at 100%

Time to debug. Attach via gdb or strace to determine what the spinners
are doing.

> What does that mean if the connections don't want to close normally?

Switch to Linux? :,)

> Is there a way to see what could have opened the connections?

Try the following:

http://www.sysinternals.com/ntw2k/source/tcpview.shtml

or one of the other great tools from Sysinternals.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6


From: Jason Tishler <jason(at)tishler(dot)net>
To: Colin Mangiagalli <colin(at)camara(dot)co(dot)za>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Limit on connections
Date: 2003-02-26 14:09:56
Message-ID: 20030226140956.GI772@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-cygwin

Colin,

On Tue, Feb 25, 2003 at 03:05:33PM +0200, Colin Mangiagalli wrote:
> Thanks Jason

You are welcome.

> Just to let you know. I finally solved the Permission Denied problem
> when the database was trying to write to the transaction logs.
>
> [snip]
>
> So now I scheduled pg_dump to run every night and they just back up
> the one file. The machine is still up :-)

Thanks for the above. It's nice to know that some Cygwin PostgreSQL
problems are not due to Cygwin! :.)

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6