From: Marek Florianczyk <franki@tpi.pl>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: performance problem - 10.000 databases
Date: 05 Nov 2003 19:19:39 +0100
Message-ID: <1068056378.28827.172.camel@franki-laptop.tpi.pl> (raw)
In-Reply-To: <3453.1068055189@sss.pgh.pa.us>
References: <1067594647.22286.57.camel@franki-laptop.tpi.pl>
<9643.1067610219@sss.pgh.pa.us>
<1068039213.28814.116.camel@franki-laptop.tpi.pl>
<3453.1068055189@sss.pgh.pa.us>
W liście z śro, 05-11-2003, godz. 18:59, Tom Lane pisze:
> Marek Florianczyk <franki@tpi.pl> writes:
> > Each client was doing:
>
> > 10 x connect,"select * from table[rand(1-4)] where
> > number=[rand(1-1000)]",disconnect--(fetch one row)
>
> Seems like this is testing the cost of connect and disconnect to the
> exclusion of nearly all else. PG is not designed to process just one
> query per connection --- backend startup is too expensive for that.
> Consider using a connection-pooling module if your application wants
> short-lived connections.
You right, maybe typical php page will have more queries "per view"
How good is connection-pooling module when connection from each virtual
site is uniq? Different user and password, and differen schemas and
permissions, so this connect-pooling module would have to switch between
users, without reconnecting to database? Impossible ?
>
> > I noticed that queries like: "\d table1" "\di" "\dp" are extremly slow,
>
> I thought maybe you'd uncovered a performance issue with lots of
> schemas, but I can't reproduce it here. I made 10000 schemas each
> containing a table "mytab", which is about the worst case for an
> unqualified "\d mytab", but it doesn't seem excessively slow --- maybe
> about a quarter second to return the one mytab that's actually in my
> search path. In realistic conditions where the users aren't all using
> the exact same table names, I don't think there's an issue.
But did you do that under some database load ? eg. 100 clients
connected, like in my example ? When I do these queries "\d" without any
clients connected and after ANALYZE it's fast, but only 100 clients is
enough to lengthen query time to 30 sec. :(
I've 3000 schemas named: test[1-3000] and 3000 users named test[1-3000]
in each schema there is four tables (table1 table2 table3 table4 )
each table has 3 column (int,text,int) and some of them has also
indexes.
If you want, I will send perl script that forks to 100 process and
perform my queries.
greetings
Marek
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: franki@tpi.pl, tgl@sss.pgh.pa.us
Subject: Re: performance problem - 10.000 databases
In-Reply-To: <1068056378.28827.172.camel@franki-laptop.tpi.pl>
References: <1067594647.22286.57.camel@franki-laptop.tpi.pl> <9643.1067610219@sss.pgh.pa.us> <1068039213.28814.116.camel@franki-laptop.tpi.pl> <3453.1068055189@sss.pgh.pa.us> <1068056378.28827.172.camel@franki-laptop.tpi.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox