[Pgpool-general] Pgpool almost 20 times slower than normal postgres

Fernando Morgenstern fernando at consultorpc.com
Mon Feb 22 01:58:25 UTC 2010


Hello Steven,

Thanks a lot for your answer. After some searches, it helped me to understand a bit of why pgpool is slower.

Btw, I have verified the pgpool parameters that you suggested and they all seem fine.

And, as you said, our test consists of a few queries and almost no concurrent connections, so i guess it is normal to have a slower result with pgpool as it adds a new layer between application and database.

Best Regards,
---

Fernando Marcelo
www.consultorpc.com
fernando at consultorpc.com

Em 19/02/2010, às 16:28, Steven Crandell escreveu:

> Sorry no one got back to you on this.
> Here are my thoughts on the matter.
> 
> If your test suite consists of running one simple query against pgpool vs. running the query directly against the pg host, then yes, pgpool will always lose that race since pgpool is not intended to act as a speed up in a situation like that.  A more relevant test suite would include a several thousand (ideally different) queries sent at high speed.
> 
> As it relates to getting that single query speed closer to native postgres speeds, I would recommend you ensure that you have max_pool set to something >= the number of backend nodes so that pgpool doesn't have to setup a new connection every time you query it.  In conjunction with that, make sure you have good settings for connection_life_time and child_life_time so that your cached connections are effectively reused.  Also confirm that your backend_weight* parameters are load balancing queries to your various hosts properly.  (e.g. make sure you don't have one backend host fielding 100% of inbound queries).
> 
> All of these parameters are explained in detail here.
> http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html
> 
> 
> On Fri, Feb 19, 2010 at 8:34 AM, Fernando Morgenstern <fernando at consultorpc.com> wrote:
> Hello,
> 
> I sent this email almost one month ago but didn't got any answer. I am still having this problem and can't find how to solve it.
> 
> Is there any additional info that i can provide?
> 
> Also, could you kindly share your experience with pgpool in this situation? ( eg.: this is normal to happen or i solved this problem by changing X )
> 
> Thanks!
> 
> 
> Em 28/01/2010, às 08:59, Fernando Morgenstern escreveu:
> 
> > Hello,
> >
> > We have been trying to identify what is causing our db cluster to be so slow but, as this is the first one that i am working, i am not sure if what i am getting is normal or not.
> >
> > Basically we have a JSP script that connects to database and run a simple query on a table that currently have 23 rows:
> >
> > select id,name from mytable;
> >
> > This script returns the query time. So, when we run agains postgres directly, we get about 2 miliseconds.
> >
> > But when we run against pgpool ( with 1-4 nodes, tried with all node count ), we get 40-42 miliseconds.
> >
> >
> > What i would like to ask is it this is the normal behavior or could be something wrong with my setup?
> >
> > Is there anything that i can do to speed up it?
> >
> > Pgpool version is 2.3.1.
> >
> > Best Regards,
> > ---
> >
> > Fernando Marcelo
> > www.consultorpc.com
> > fernando at consultorpc.com
> > _______________________________________________
> > Pgpool-general mailing list
> > Pgpool-general at pgfoundry.org
> > http://pgfoundry.org/mailman/listinfo/pgpool-general
> 
> _______________________________________________
> Pgpool-general mailing list
> Pgpool-general at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pgpool-general
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pgfoundry.org/pipermail/pgpool-general/attachments/20100221/089dbd72/attachment-0001.html>


More information about the Pgpool-general mailing list