performance "tests"

Поиск
Список
Период
Сортировка
Искать

performance "tests"

От:
Raphael Bauduin <raphael@be.easynet.net>
Дата:
Hi,

having read on this list (some time ago) that inserts could become slow
when there are foreign keys constraints, I wanted to test it. So I
created a DB with 5 tables (T1 -> T5) with, for 0

Re: performance "tests"

От:
Oliver Elphick <olly@lfix.co.uk>
Дата:
Вложения:
On Wed, 2002-04-10 at 14:00, Raphael Bauduin wrote:
...
> dpkg -l postgresql
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
> |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
> ||/ Name           Version        Description
> +++-==============-==============-============================================
> ii  postgresql     7.1.3-7        Object-relational SQL database, descended fr

7.2.1 is available in Debian unstable.

It might be better to run tests on the latest version.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C

     "But seek ye first the kingdom of God, and his  
      righteousness; and all these things shall be added  
      unto you."     Matthew 6:33 

Re: performance "tests"

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Raphael Bauduin  writes:
> At some times, it seems to hang: it doesn't insert any rows for more
> than 10 seconds. At that time, the postmaster process takes 0%. Why is
> that?

At a guess, you're seeing the syncer daemon flushing a lot of dirty
kernel disk buffers out to disk, and thereby monopolizing disk I/O.
I haven't experimented too much with Linux, but on HPUX it's not
difficult for a sync() call to bring the system to its knees for many
seconds, if you've got application programs that have written a whole
lot of pages since the last sync.

> What's strange is that everything else hangs also! Would that be due
> to the CPU??

The CPU is free, but everything that wants to access disk is starved
for disk bandwidth ...

> ii  postgresql     7.1.3-7        Object-relational SQL database, descended fr

If you're going to run tests on foreign-key performance, please use
7.2.*.

			regards, tom lane

Re: performance "tests"

От:
Naomi Walker <nwalker@eldocomp.com>
Дата:
 From my many years of Informix knowledge, we noticed that checkpoints, 
during high activity times, did take a long time, because it locked the 
shared memory segment.  We found that setting the checkpoint knobs to flush 
almost constantly, overall, was much better for performance.

Looking in postgresql.conf, it seems that some tweaking of : 
CHECKPOINT_SEGMENTS and CHECKPOINT_TIMEOUT are in order.

I also see some interesting items in the WAL_* configuration parameters, 
and would look at these as well.  Again, in Informix-speak, we were able to 
control when the buffers flushed to disk, with parameters like:
                         Start flushing buffers when they are X% full
                            and keep flushing until they are X% full

Overall, having TONS of buffers helped benchmark performance, but could 
have slowed down checkpoints had we not continually flushed to disk.

At 11:37 AM 4/10/02 -0400, Tom Lane wrote:
>Raphael Bauduin  writes:
> > At some times, it seems to hang: it doesn't insert any rows for more
> > than 10 seconds. At that time, the postmaster process takes 0%. Why is
> > that?
>
>At a guess, you're seeing the syncer daemon flushing a lot of dirty
>kernel disk buffers out to disk, and thereby monopolizing disk I/O.
>I haven't experimented too much with Linux, but on HPUX it's not
>difficult for a sync() call to bring the system to its knees for many
>seconds, if you've got application programs that have written a whole
>lot of pages since the last sync.


--
Naomi Walker
Chief Information Officer
Eldorado Computing, Inc.
602-604-3100  ext 242 

Re: performance "tests"

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Naomi Walker wrote:
>  From my many years of Informix knowledge, we noticed that checkpoints, 
> during high activity times, did take a long time, because it locked the 
> shared memory segment.  We found that setting the checkpoint knobs to flush 
> almost constantly, overall, was much better for performance.
> 
> Looking in postgresql.conf, it seems that some tweaking of : 
> CHECKPOINT_SEGMENTS and CHECKPOINT_TIMEOUT are in order.
> 
> I also see some interesting items in the WAL_* configuration parameters, 
> and would look at these as well.  Again, in Informix-speak, we were able to 
> control when the buffers flushed to disk, with parameters like:
>                          Start flushing buffers when they are X% full
>                             and keep flushing until they are X% full
> 
> Overall, having TONS of buffers helped benchmark performance, but could 
> have slowed down checkpoints had we not continually flushed to disk.

Actually, we don't lock shared memory like Informix does.  As I
remember, other backends can write to the WAL while we are doing the
checkpoint.  In fact, there is code in there that expects the WAL file
may grow during checkpointing.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: performance "tests"

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Tom Lane wrote:
> Raphael Bauduin  writes:
> > At some times, it seems to hang: it doesn't insert any rows for more
> > than 10 seconds. At that time, the postmaster process takes 0%. Why is
> > that?
> 
> At a guess, you're seeing the syncer daemon flushing a lot of dirty
> kernel disk buffers out to disk, and thereby monopolizing disk I/O.
> I haven't experimented too much with Linux, but on HPUX it's not
> difficult for a sync() call to bring the system to its knees for many
> seconds, if you've got application programs that have written a whole
> lot of pages since the last sync.

Some BSD's implement trickle sync, for this very reason.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: performance "tests"

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Raphael Bauduin  writes:
> I just installed 7.2.1. I run 7.1.3 in parallel. after I run the script
> to introduce 1000 rows in T1 in each version, deleting is much faster
> with 7.1.3 than with 7.2.1 (I took the same configuration parameters for
> both servers...).  When running the delete query in parallel, 7.1.3
> finishes really faster.

Uh, what was the test query again?  And what does EXPLAIN say about it
on each version?

			regards, tom lane

Re: performance "tests"

От:
Raphael Bauduin <raphael@be.easynet.net>
Дата:
On Thu, Apr 11, 2002 at 10:34:40AM -0400, Tom Lane wrote:
> Raphael Bauduin  writes:
> > I just installed 7.2.1. I run 7.1.3 in parallel. after I run the script
> > to introduce 1000 rows in T1 in each version, deleting is much faster
> > with 7.1.3 than with 7.2.1 (I took the same configuration parameters for
> > both servers...).  When running the delete query in parallel, 7.1.3
> > finishes really faster.
> 
> Uh, what was the test query again?  And what does EXPLAIN say about it
> on each version?

I just want to delete all rows in the table T1. As all other tables have
foreign keys coming from T1, all rows in all tables are deleted.

For example, from T1:

test=# select * from T1 where k1>50 and k1< 55;

  k1 | k2 | k3 | k4 | k5 
  ----+----+----+----+----
  51 |  3 | 42 | 26 |  7
  52 | 15 | 32 | 35 |  2
  53 |  4 |  8 | 11 | 12
  54 |  3 | 33 | 38 | 26
  (4 rows)

for Tj, kj is primary key.
for 0

Re: performance "tests"

От:
Raphael Bauduin <raphael.bauduin@be.easynet.net>
Дата:
> If you're going to run tests on foreign-key performance, please use
> 7.2.*.


I just installed 7.2.1. I run 7.1.3 in parallel. after I run the script
to introduce 1000 rows in T1 in each version, deleting is much faster
with 7.1.3 than with 7.2.1 (I took the same configuration parameters for
both servers...).  When running the delete query in parallel, 7.1.3
finishes really faster.

For inserts, the 7.2.1 is slightly faster for the first 3000 inserts,
from inserts from 3000 to 5000 it's more or less equivalent

I'll go further in documentation to look if I forgot something, but if
you have any hints, they're welcome :-)


Raph
FAQ