X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 264BB54F2C for ; Tue, 8 Mar 2005 18:17:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52936-07 for ; Tue, 8 Mar 2005 18:17:39 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 650C15465C for ; Tue, 8 Mar 2005 18:17:38 +0000 (GMT) Received: (qmail 23899 invoked from network); 8 Mar 2005 18:16:39 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 8 Mar 2005 18:16:39 -0000 Message-ID: <422DEC3C.5000903@fastcrypt.com> Date: Tue, 08 Mar 2005 13:17:32 -0500 From: Dave Cramer Reply-To: pg@fastcrypt.com Organization: Postgres International User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Prajakt Deolasee Cc: pgsql-jdbc@postgresql.org Subject: Re: Postgres is slow References: <6bf1b0a005030805495ec76763@mail.gmail.com> <422DE271.5010701@hogranch.com> <6bf1b0a0050308095142eef89b@mail.gmail.com> In-Reply-To: <6bf1b0a0050308095142eef89b@mail.gmail.com> Content-Type: multipart/alternative; boundary="------------030501080108030503060803" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.313 tagged_above=0 required=5 tests=AWL, HTML_20_30, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: X-Archive-Number: 200503/72 X-Sequence-Number: 12464 This is a multi-part message in MIME format. --------------030501080108030503060803 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit scaling to 1000 inserts/second is a factor of hardware and tuning, not postgres in general osdl is currently seeing 5000 transactions per seconds. indexing on the byte array can definately be one of the issues. Dave Prajakt Deolasee wrote: >Thanks guys.. I will try of the suggested steps. But one thing that I >do not understand that why should the performance deteriorate with >exactly same data with subsequent tests. And its juts gets worse as I >keep running it. > > > >>also, the defaults in $PGDATA/postgresql.conf in 7.4 are *VERY* inefficient. >>there are a few key parameters that can make a significant difference in >>overall performance. >> >> >John, do you have any idea which parameters to change? > >I tried similar tests also against PSQL 8.0 as well. But the results >are exactly same. > >My final usage is going to be exteremly high. I would need something >like 1000 inserts/updates per sec. Do you think PSQL will scale? > >Can the indexing on the byte array be one of the issue? > >-Prajakt > > >On Tue, 08 Mar 2005 09:35:45 -0800, John R Pierce wrote: > > >>>>I am using Postgres 7.4 on Fedora 3.0. It is running with the default >>>>configuration. >>>> >>>> >>.... >> >> >>>Probably this is not the right list for this. >>>Did you run vacuum after inserting the records? >>>Check your statement with explain analyze, it will show you why is it >>>slow. >>> >>> >>also, check serverlog in the data directory (/var/pgsql/data is the >>Redhat/Fedora default, I believe). If you're logging lots of errors, that file >>will grow, and they don't manage it. >> >>also, the defaults in $PGDATA/postgresql.conf in 7.4 are *VERY* inefficient. >>there are a few key parameters that can make a significant difference in >>overall performance. >> >>and, crontab (from the postgres user account) a vacuumdb every hour or so if >>you're doing lots of activity. once a day or week, do a vacuumdb -z to >>reindex stuff. >> >>and, shut postgres down, mv the $PGDATA directory to a different dedicated >>physical disk drive, and symlink it, then restart postgres. >> >>I've found that 7.x pgsql databases periodically need to be pg_dump'd, dropdb, >>then reloaded from the dump to continue to perform well... on a heavy use web >>server database which includes a busy user forum, I find doing this about 2-3 >>times a year keeps things smooth. there may be a better way to clean them up, >>but I've not found it. >> >>---------------------------(end of broadcast)--------------------------- >>TIP 4: Don't 'kill -9' the postmaster >> >> >> > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > > > > -- Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561 --------------030501080108030503060803 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit scaling to 1000 inserts/second is a factor of hardware and tuning, not postgres in general

osdl is currently seeing 5000 transactions per seconds.

indexing on the byte array can definately be one of the issues.

Dave

Prajakt Deolasee wrote:
Thanks guys.. I will try of the suggested steps. But one thing that I
do not understand that why should the performance deteriorate with
exactly same data with subsequent tests. And its juts gets worse as I
keep running it.

  
also, the defaults in $PGDATA/postgresql.conf in 7.4 are *VERY* inefficient.
there are a few key parameters that can make a significant difference in
overall performance.
    
John, do you have any idea which parameters to change?

I tried similar tests also against PSQL 8.0 as well. But the results
are exactly same.

My final usage is going to be exteremly high. I would need something
like 1000 inserts/updates per sec. Do you think PSQL will scale?

Can the indexing on the byte array be one of the issue?

-Prajakt


On Tue, 08 Mar 2005 09:35:45 -0800, John R Pierce <pierce@hogranch.com> wrote:
  
I am using Postgres 7.4 on Fedora 3.0. It is running with the default
configuration.
        
....
    
Probably this is not the right list for this.
Did you run vacuum after inserting the records?
Check your statement with explain analyze, it will show you why is it
slow.
      
also, check serverlog in the data directory (/var/pgsql/data is the
Redhat/Fedora default, I believe).  If you're logging lots of errors, that file
will grow, and they don't manage it.

also, the defaults in $PGDATA/postgresql.conf in 7.4 are *VERY* inefficient.
there are a few key parameters that can make a significant difference in
overall performance.

and, crontab (from the postgres user account) a vacuumdb every hour or so if
you're doing lots of activity.   once a day or week, do a vacuumdb -z to
reindex stuff.

and, shut postgres down, mv the $PGDATA directory to a different dedicated
physical disk drive, and symlink it, then restart postgres.

I've found that 7.x pgsql databases periodically need to be pg_dump'd, dropdb,
then reloaded from the dump to continue to perform well...  on a heavy use web
server database which includes a busy user forum, I find doing this about 2-3
times a year keeps things smooth.  there may be a better way to clean them up,
but I've not found it.

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

    

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

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


  

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561
--------------030501080108030503060803--