[Pgpool-general] Cluster pgpool-II + PHP

Tatsuo Ishii ishii at sraoss.co.jp
Fri Feb 19 00:27:01 UTC 2010


> Hello there,
> 
> We do have a cluster with pgpool-II 2.3 and 2 backend Postgres 8.3.9 runing
> in Centos 5.4 with max_connections=200. This cluster is used by web
> apllication in PHP 5.2 that connects to DB with pg_pconnect and always with
> same user. I do have a couple of doubts...

I assume that you have single pgpool-II server, not two or more.

> I have been reading about the problems of pg_pconnect with pgpool and we are
> going to change the connections to pg_connect. The problem is that at the
> moment we don't have time to change all the code before the system go to
> produccion.
> 
> I also saw that if your application access the DB always with the same user,
> it will be the best to set max_pool = 1 in pgpool.conf.
> 
> Based on these guidelines, I think the best configuration in my case is set
> num_init_children = 200 and max_pool = 1, is that correct?

Yes.

> When we do change
> the connection to the pg_connect should I keep these values?

Yes. Also you could make num_init_children smaller, not larger to
expect to reduce the number of concurrent connection to PostgreSQL
smaller. This may or may not increase the throughput of PostgreSQL
depending on your hardware performance. Point is, set
num_init_children close enough to your PostgreSQL's best "throughput
point".

> My other question is, the maintenance tasks reindex and vacuum, should be
> made over pgpool or over each backend?

Vaccuum with verbose option should not be used over pgpool. It may
cause "kind mismatch" error because number of messages returned from
vacuum may vary on each backend(I have a plan to improve
this). Otherwise you could made these commands over pgpool or over
each backend.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the Pgpool-general mailing list