Re: [PERFORM] getting better performance

2006-07-07 Thread Markus Schaber
Hi, Eugeny,

Eugeny N Dzhurinsky wrote:

 Do you add / remove tables a lot?  Could be you've got system catalog
 bloat.
 
 Yes, almost each table is dropped and re-created in 3-5 days.

If your really recreate the same table, TRUNCATE may be a better
solution than dropping and recreation.

HTH,
Markus

-- 
Markus Schaber | Logical TrackingTracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

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


[PERFORM] getting better performance

2006-07-06 Thread Eugeny N Dzhurinsky
Hello!

I have a postgresql server serving thousands of tables. Sometime there are
queries which involves several tables.

In postgresql.conf I have these settings:

shared_buffers = 4
work_mem = 8192
maintenance_work_mem = 16384
max_stack_depth = 2048

all other settings are left by default (except ones needed for pg_autovacuum).

Is there anything I can tune to get better performance?

-- 
Eugene N Dzhurinsky

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


Re: [PERFORM] getting better performance

2006-07-06 Thread Ivan Zolotukhin

On 7/6/06, A. Kretschmer [EMAIL PROTECTED] wrote:

am  06.07.2006, um  9:40:16 +0300 mailte Eugeny N Dzhurinsky folgendes:
 In postgresql.conf I have these settings:

 shared_buffers = 4
 work_mem = 8192
 maintenance_work_mem = 16384
 max_stack_depth = 2048

 all other settings are left by default (except ones needed for pg_autovacuum).

 Is there anything I can tune to get better performance?

You can set log_min_duration_statement to log slow querys and then
analyse this querys.


When you collect your logs try PgFouine
http://pgfouine.projects.postgresql.org/
to understand what queries should be optimized and what's the reason
of poor performance.

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

  http://archives.postgresql.org


Re: [PERFORM] getting better performance

2006-07-06 Thread Eugeny N Dzhurinsky
On Thu, Jul 06, 2006 at 09:28:39AM -0500, Scott Marlowe wrote:
 On Thu, 2006-07-06 at 01:40, Eugeny N Dzhurinsky wrote:
 Do you add / remove tables a lot?  Could be you've got system catalog
 bloat.

Yes, almost each table is dropped and re-created in 3-5 days.

 do you have autovacuum running?

Yes.

 What version of pgsql are you running?

psql -V
psql (PostgreSQL) 8.0.0

 What OS?

CentOS release 3.7 (Final)

 What file system?

ext3

 What kind of machine are you using?

Pentium IV, 1.8 GHz

 How much memory does it have?

512 Mb RAM

 How many disk drives?

single

 Are you using RAID?  hardware / software?  battery backed cache or no?

no

 Do you have one or two, or thousands of connections at a time?

something like 20 connections (peak).

 Do you use connection pooling if you have lots of connections to handle?

My application uses Jakarta Commons DBCP module.

-- 
Eugene Dzhurinsky

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [PERFORM] getting better performance

2006-07-06 Thread Merlin Moncure

On 7/6/06, Eugeny N Dzhurinsky [EMAIL PROTECTED] wrote:

Hello!

I have a postgresql server serving thousands of tables. Sometime there are
queries which involves several tables.



In postgresql.conf I have these settings:

shared_buffers = 4
work_mem = 8192
maintenance_work_mem = 16384
max_stack_depth = 2048

all other settings are left by default (except ones needed for pg_autovacuum).

Is there anything I can tune to get better performance?


you may want to explore upping your FSM settings with that many tables.

Merlin

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

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


Re: [PERFORM] getting better performance

2006-07-06 Thread Scott Marlowe
On Thu, 2006-07-06 at 10:11, Eugeny N Dzhurinsky wrote:
 On Thu, Jul 06, 2006 at 09:28:39AM -0500, Scott Marlowe wrote:
  On Thu, 2006-07-06 at 01:40, Eugeny N Dzhurinsky wrote:
  Do you add / remove tables a lot?  Could be you've got system catalog
  bloat.
 
 Yes, almost each table is dropped and re-created in 3-5 days.

  do you have autovacuum running?
 
 Yes.

Hopefully, that will keep the system catalogs from getting overly fat. 
You still need to check their size every so often to make sure they're
not getting out of line.  

you might wanna run a vacuum verbose and see what it has to say.

  What version of pgsql are you running?
 
 psql -V
 psql (PostgreSQL) 8.0.0

You should update.  x.0.0 versions often have the nastiest of the data
loss bugs of any release versions of postgresql.  8.0 is up to 8.0.8
now.  The upgrades are generally painless (backup anyway, just in case)
and can be done in place.  just down postgres, rpm -Uvh the packages and
restart postgres

  What OS?
 
 CentOS release 3.7 (Final)
 
  What file system?
 
 ext3
 
  What kind of machine are you using?
 
 Pentium IV, 1.8 GHz
 
  How much memory does it have?
 
 512 Mb RAM

That's kind of small for a database server.  If your data set is fairly
small it's alright, but if you're working on gigs of data in your
database, the more memory the better.

  How many disk drives?
 
 single

OTOH, if you're doing a lot of committing / writing to the hard drives,
a single disk drive is suboptimal

Is this SCSI, PATA or SATA?  If it's [SP]ATA, then you've likely got no
real fsyncing, and while performance won't be a problem, reliability
should the machine crash would be.  If it's SCSI, then it could be a
bottle neck for writes.

  Are you using RAID?  hardware / software?  battery backed cache or no?
 
 no

I'd recommend looking into it, unless you're CPU bound.  A decent RAID
controller with battery backed cache and a pair of drives in a mirror
setup can be a marked improved to start with, and you can add more
drives as time goes by if needs be.

My guess is that you've got sys catalog bloat.  You might have to down
the database to single user mode and run a vacuum on the system catalogs
from there.  That's how it was in the old days of 7.x databases anyway.

If you don't have sys cat bloat, then you're probably CPU / memory bound
right now.  unless you're writing a lot, then you're likely disk i/o
bound, but I kinda doubt it.

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