Thread: General Performance questions

General Performance questions

From
"Delao, Darryl W"
Date:

I have been monitoring netstat -c on my db server for a few days now.  I am trying to determine if when I see a postgres connection, if that is indeed just 1 connection or if it is a bunch of connections tied up in 1.  The other day I had postgres set to a limit of 128 connections, and that was reached.  But at no time while monitoring netstat -c did I see 128 connections!  At this point, im assuming that netstat-c does not provide an accurate count of current connections.  Anyone have any thoughts on this?

 

Darryl

 

 

 

Re: General Performance questions

From
Tom Lane
Date:
"Delao, Darryl W" <ddelao@ou.edu> writes:
> I have been monitoring netstat -c on my db server for a few days now.  I am
> trying to determine if when I see a postgres connection, if that is indeed
> just 1 connection or if it is a bunch of connections tied up in 1.

One connection is one connection.

> The
> other day I had postgres set to a limit of 128 connections, and that was
> reached.  But at no time while monitoring netstat -c did I see 128
> connections!

Are you watching both Unix and TCP sockets?  Have you compared netstat
to ps output?

            regards, tom lane

Re: General Performance questions

From
"Delao, Darryl W"
Date:
Netstat -c shows both tcp and unix...at no time did they ever show more than
4 connections when the server reached its limit..

Whats a good way to check ps output?


Darryl


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Tuesday, March 11, 2003 9:38 AM
To: Delao, Darryl W
Cc: 'pgsql-novice@postgresql.org'; 'pgsql-general@postgresql.org'
Subject: Re: [GENERAL] General Performance questions

"Delao, Darryl W" <ddelao@ou.edu> writes:
> I have been monitoring netstat -c on my db server for a few days now.  I
am
> trying to determine if when I see a postgres connection, if that is indeed
> just 1 connection or if it is a bunch of connections tied up in 1.

One connection is one connection.

> The
> other day I had postgres set to a limit of 128 connections, and that was
> reached.  But at no time while monitoring netstat -c did I see 128
> connections!

Are you watching both Unix and TCP sockets?  Have you compared netstat
to ps output?

            regards, tom lane

Re: General Performance questions

From
"Delao, Darryl W"
Date:
Netstat shows live connections every 2 seconds with -c

-----Original Message-----
From: Neil Conway [mailto:neilc@samurai.com]
Sent: Tuesday, March 11, 2003 11:12 AM
To: Delao, Darryl W
Cc: 'pgsql-novice@postgresql.org'; 'pgsql-general@postgresql.org'
Subject: Re: [GENERAL] General Performance questions

On Tue, 2003-03-11 at 09:14, Delao, Darryl W wrote:
> I have been monitoring netstat -c on my db server for a few days now.
> I am trying to determine if when I see a postgres connection, if that
> is indeed just 1 connection or if it is a bunch of connections tied up
> in 1.  The other day I had postgres set to a limit of 128 connections,
> and that was reached.  But at no time while monitoring netstat -c did
> I see 128 connections!  At this point, im assuming that netstat-c does
> not provide an accurate count of current connections.  Anyone have any
> thoughts on this?

Is there a reason why you're trying to use netstat rather than the
pg_stat_activity system view?

http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/monitoring-stats
.html

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC



Re: General Performance questions

From
Neil Conway
Date:
On Tue, 2003-03-11 at 09:14, Delao, Darryl W wrote:
> I have been monitoring netstat -c on my db server for a few days now.
> I am trying to determine if when I see a postgres connection, if that
> is indeed just 1 connection or if it is a bunch of connections tied up
> in 1.  The other day I had postgres set to a limit of 128 connections,
> and that was reached.  But at no time while monitoring netstat -c did
> I see 128 connections!  At this point, im assuming that netstat-c does
> not provide an accurate count of current connections.  Anyone have any
> thoughts on this?

Is there a reason why you're trying to use netstat rather than the
pg_stat_activity system view?

http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/monitoring-stats.html

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC




Re: General Performance questions

From
"scott.marlowe"
Date:
On many boxes, something like:

ps ax |grep postgres

will do.

On Tue, 11 Mar 2003, Delao, Darryl W wrote:

> Netstat -c shows both tcp and unix...at no time did they ever show more than
> 4 connections when the server reached its limit..
>
> Whats a good way to check ps output?
>
>
> Darryl
>
>
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Tuesday, March 11, 2003 9:38 AM
> To: Delao, Darryl W
> Cc: 'pgsql-novice@postgresql.org'; 'pgsql-general@postgresql.org'
> Subject: Re: [GENERAL] General Performance questions
>
> "Delao, Darryl W" <ddelao@ou.edu> writes:
> > I have been monitoring netstat -c on my db server for a few days now.  I
> am
> > trying to determine if when I see a postgres connection, if that is indeed
> > just 1 connection or if it is a bunch of connections tied up in 1.
>
> One connection is one connection.
>
> > The
> > other day I had postgres set to a limit of 128 connections, and that was
> > reached.  But at no time while monitoring netstat -c did I see 128
> > connections!
>
> Are you watching both Unix and TCP sockets?  Have you compared netstat
> to ps output?
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


Re: General Performance questions

From
"scott.marlowe"
Date:
On Tue, 11 Mar 2003, Delao, Darryl W wrote:

> I have been monitoring netstat -c on my db server for a few days now.  I am
> trying to determine if when I see a postgres connection, if that is indeed
> just 1 connection or if it is a bunch of connections tied up in 1.  The
> other day I had postgres set to a limit of 128 connections, and that was
> reached.  But at no time while monitoring netstat -c did I see 128
> connections!  At this point, im assuming that netstat-c does not provide an
> accurate count of current connections.  Anyone have any thoughts on this?

something on your machine is horribly wrong.  You should, on an unloaded
box, be able to open at least 100 connections a second.  1,000 or more is
common.

What OS etc... are you running?  What does free, top, or ps ax|grep post
show during this process?  Are you running out of swap or free memory or
something like that?  Is there a lot of disk access when you connect
(iostat -x)???