[DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Halley Pacheco de Oliveira
In PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity - 
23.1. Standard Unix
Tools is written:

The user, database, and connection source host items remain the same for the 
life of the client
connection, but the activity indicator changes.

But look at that:

psql -U sistemas -h 192.168.0.1 template1

ps aux | grep ^postgres

postgres  3908  0.0  0.3 19948 2000 ?S05:45   0:00 
/usr/bin/postmaster -p 5432 -D
/var/lib/pgsql/data
postgres  3968  0.0  0.3 10748 1792 ?S05:45   0:00 postgres: stats 
buffer process
postgres  3969  0.0  0.3  9756 1848 ?S05:45   0:00 postgres: stats 
collector process
postgres  8223  0.0  0.5 20348 2608 ?S06:42   0:00 postgres: 
sistemas template1
192.168.0.1 idle

template1=# \c teste

ps aux | grep ^postgres

postgres  3908  0.0  0.3 19948 2000 ?S05:45   0:00 
/usr/bin/postmaster -p 5432 -D
/var/lib/pgsql/data
postgres  3968  0.0  0.3 10748 1792 ?S05:45   0:00 postgres: stats 
buffer process
postgres  3969  0.0  0.3  9756 1848 ?S05:45   0:00 postgres: stats 
collector process
postgres  8244  0.0  0.5 20348 2608 ?S06:43   0:00 postgres: 
sistemas teste
192.168.0.1 idle

So the database name didn't remain the same, neither the process id. Connecting 
to another
database creates a brand new connection using other server process as it seems 
to be. I think it
should be written in this paragraph. I couldn't imagine that, for me the 
process was still the
same.

Regards,
Halley

__
Converse com seus amigos em tempo real com o Yahoo! Messenger 
http://br.download.yahoo.com/messenger/ 

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Peter Eisentraut
Am Dienstag, 26. Juli 2005 12:06 schrieb Halley Pacheco de Oliveira:
> The user, database, and connection source host items remain the same for
> the life of the client connection, but the activity indicator changes.

> So the database name didn't remain the same, neither the process id.
> Connecting to another database creates a brand new connection using other
> server process as it seems to be. I think it should be written in this
> paragraph. I couldn't imagine that, for me the process was still the same.

What is the problem here?  You create a new connection, so you get the 
information in the new connection, as documented.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Halley Pacheco de Oliveira
There is no problem, just a surprise. Once I was connected to one database I 
didn't expect that a
connection to another database inside psql would close one process and fork a 
new process. Once
the chapter is about Monitoring Database Activity, I think that it would be 
good to alert the
readers about this fact. Maybe other users dont't expect this fact too. Just 
that.

Regards,
Halley

--- Peter Eisentraut <[EMAIL PROTECTED]> escreveu:

> Am Dienstag, 26. Juli 2005 12:06 schrieb Halley Pacheco de Oliveira:
> > The user, database, and connection source host items remain the same for
> > the life of the client connection, but the activity indicator changes.
> 
> > So the database name didn't remain the same, neither the process id.
> > Connecting to another database creates a brand new connection using other
> > server process as it seems to be. I think it should be written in this
> > paragraph. I couldn't imagine that, for me the process was still the same.
> 
> What is the problem here?  You create a new connection, so you get the 
> information in the new connection, as documented.
> 
> -- 
> Peter Eisentraut
> http://developer.postgresql.org/~petere/
> 






___ 
Yahoo! Acesso Grátis - Internet rápida e grátis. 
Instale o discador agora! http://br.acesso.yahoo.com/

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-26 13:48:55 +:
> --- Peter Eisentraut <[EMAIL PROTECTED]> escreveu:
> 
> > Am Dienstag, 26. Juli 2005 12:06 schrieb Halley Pacheco de Oliveira:
> > > The user, database, and connection source host items remain the same for
> > > the life of the client connection, but the activity indicator changes.
> > 
> > > So the database name didn't remain the same, neither the process id.
> > > Connecting to another database creates a brand new connection using other
> > > server process as it seems to be. I think it should be written in this
> > > paragraph. I couldn't imagine that, for me the process was still the same.
> > 
> > What is the problem here?  You create a new connection, so you get the 
> > information in the new connection, as documented.
> 
> There is no problem, just a surprise. Once I was connected to one database I 
> didn't expect that a
> connection to another database inside psql would close one process and fork a 
> new process. Once
> the chapter is about Monitoring Database Activity, I think that it would be 
> good to alert the
> readers about this fact. Maybe other users dont't expect this fact too. Just 
> that.

If anywhere, such information would belong to the psql(1)
documentation, where it already is:

\connect (or \c) [ dbname [ username ] ]
   Establishes  a  connection to a new database and/or under a user
   name. The previous connection is closed.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Halley Pacheco de Oliveira
What surprises me is not that the previous connection is closed and a new 
connection is opened.
What surprises me is the fact that the previous process is killed and a new 
process is forked just
to connect to another database with the same user. I was expecting that the new 
connection could
use the same process. If you are monitoring user activity you must know that 
when the user
connects to another database another process is created, or even worst, if the 
user connects to
the same database again another process is created.

psql -U sistemas -h 192.168.0.1 teste

ps aux | grep ^postgres
postgres  3910  0.0  0.3 20320 2000 ?S10:31   0:00 
/usr/bin/postmaster -p 5432 -D
/var/lib/pgsql/data
postgres  3968  0.0  0.3 11120 1792 ?S10:31   0:00 postgres: stats 
buffer process
postgres  3969  0.0  0.3 10128 1844 ?S10:31   0:00 postgres: stats 
collector process
postgres 14006  0.0  0.5 20720 2640 ?S14:08   0:00 postgres: 
sistemas teste
192.168.0.1 idle

teste=# \c teste

ps aux | grep ^postgres
postgres  3910  0.0  0.3 20320 2000 ?S10:31   0:00 
/usr/bin/postmaster -p 5432 -D
/var/lib/pgsql/data
postgres  3968  0.0  0.3 11120 1792 ?S10:31   0:00 postgres: stats 
buffer process
postgres  3969  0.0  0.3 10128 1844 ?S10:31   0:00 postgres: stats 
collector process
postgres 14038  0.0  0.5 20720 2608 ?S14:09   0:00 postgres: 
sistemas teste
192.168.0.1 idle

It was not clear to me this relationship between connection and process. Now it 
is.

Regards,
Halley

--- Roman Neuhauser <[EMAIL PROTECTED]> escreveu:

> 
> If anywhere, such information would belong to the psql(1)
> documentation, where it already is:
> 
> \connect (or \c) [ dbname [ username ] ]
>Establishes  a  connection to a new database and/or under a user
>name. The previous connection is closed.







___ 
Yahoo! Acesso Grátis - Internet rápida e grátis. 
Instale o discador agora! http://br.acesso.yahoo.com/

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-26 14:17:17 -0300:
> What surprises me is not that the previous connection is closed and a
> new connection is opened.

> What surprises me is the fact that the previous process is killed and
> a new process is forked just to connect to another database with the
> same user. I was expecting that the new connection could use the same
> process. If you are monitoring user activity you must know that when
> the user connects to another database another process is created, or
> even worst, if the user connects to the same database again another
> process is created.

> It was not clear to me this relationship between connection and
> process. Now it is.

Well, there's nothing that would make this model required, but it
surely helps keep things like entropy at reasonable levels.
IOW, this behavior allows for greater stability through simpler code
and limited process lifetime.

But maybe I'm not understanding the point you're trying to make.
To make things a bit clearer: what is it that you find so disturbing
or surprising in the current PostgreSQL behavior? Why did you expect
it reusing the same process, and what benefits do you expect (or
preferably, have experimentally gained) from the alternative?

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Halley Pacheco de Oliveira
The surprise is:

Oracle - MTS -  Multi-Threaded-Server - MTS allows many user processes to share 
very few server
processes. Without MTS, each user process requires its own dedicated server 
process; a new server
process is created for each client requesting a connection. A dedicated server 
process remains
associated to the user process for the remainder of the connection. With MTS 
many user processes
connect to a dispatcher process. The dispatcher routes client requests to the 
next available
shared server process. The advantage of MTS is that system overhead is reduced, 
so the number of
users that can be supported is increased.

Contrasting with this in PostgreSQL a new process is forked just to connect to 
another database.
The PostgreSQL behavior seems similar to old Oracle versions.

Regards,
Halley
--- Roman Neuhauser <[EMAIL PROTECTED]> escreveu:

> 
> Well, there's nothing that would make this model required, but it
> surely helps keep things like entropy at reasonable levels.
> IOW, this behavior allows for greater stability through simpler code
> and limited process lifetime.
> 
> But maybe I'm not understanding the point you're trying to make.
> To make things a bit clearer: what is it that you find so disturbing
> or surprising in the current PostgreSQL behavior? Why did you expect
> it reusing the same process, and what benefits do you expect (or
> preferably, have experimentally gained) from the alternative?
> 






___ 
Yahoo! Acesso Grátis - Internet rápida e grátis. 
Instale o discador agora! http://br.acesso.yahoo.com/

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2005-07-26 22:17:12 -0300:
> --- Roman Neuhauser <[EMAIL PROTECTED]> escreveu:
> > But maybe I'm not understanding the point you're trying to make.
> > To make things a bit clearer: what is it that you find so disturbing
> > or surprising in the current PostgreSQL behavior? Why did you expect
> > it reusing the same process, and what benefits do you expect (or
> > preferably, have experimentally gained) from the alternative?
> 
> The surprise is:
> 
> Oracle - MTS -  Multi-Threaded-Server - MTS allows many user processes
> to share very few server processes. Without MTS, each user process
> requires its own dedicated server process; a new server process is
> created for each client requesting a connection. A dedicated server
> process remains associated to the user process for the remainder of
> the connection. With MTS many user processes connect to a dispatcher
> process. The dispatcher routes client requests to the next available
> shared server process. The advantage of MTS is that system overhead is
> reduced, so the number of users that can be supported is increased.

I came to PostgreSQL from MySQL, which is multithreaded, and found
PostgreSQL absolutely UNsurprising in this aspect. There's quite
a few populare programs that behave similarly.
 
> Contrasting with this in PostgreSQL a new process is forked just to
> connect to another database.  The PostgreSQL behavior seems similar to
> old Oracle versions.

So what? Is this a troll?

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [DOCS] PostgreSQL 8.0.3 Documentation - Chapter 23. Monitoring Database Activity

2005-07-26 Thread Alvaro Herrera
On Tue, Jul 26, 2005 at 10:17:12PM -0300, Halley Pacheco de Oliveira wrote:
> The surprise is:
> 
> Oracle - MTS -  Multi-Threaded-Server - MTS allows many user processes
> to share very few server processes. Without MTS, each user process
> requires its own dedicated server process; a new server process is
> created for each client requesting a connection. A dedicated server
> process remains associated to the user process for the remainder of
> the connection. With MTS many user processes connect to a dispatcher
> process. The dispatcher routes client requests to the next available
> shared server process. The advantage of MTS is that system overhead is
> reduced, so the number of users that can be supported is increased.

Hmm, seems a very similar thing can be had in Postgres by means of
pgpool.

It'd be interesting to see how are cursors handled, or any other
long-lived session-local resources for that matter, by this dispatcher
process of Oracle's.

-- 
Alvaro Herrera ()
"Crear es tan difícil como ser libre" (Elsa Triolet)

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly