[pgpool-general: 3320] Re: Weight

James Sewell james.sewell at lisasoft.com
Mon Dec 1 12:09:04 JST 2014


Can you combine it with weight?

This would allow weight to be the physical capability metric, with
database_redirect_preference_list  handling the logical routing.

so:

   backend0_weight = 2
  backend1_weight = 2
  backend2_weight = 1
  database_redirect_preference_list = '.*:standby'

Would result in the following:

If node0 master:

   - node0 = 0% reads (master, weight not used)
   - node1 = 66% reads
   - node2 = 33% reads

If node2 master

   - node0 = 50% reads
   - node1 = 50% reads
   - node2 = 0% reads (master, weight not used)

Is this possible?

Cheers,


James Sewell,
PostgreSQL Team Lead / Solutions Architect
______________________________________


 Level 2, 50 Queen St, Melbourne VIC 3000

*P *(+61) 3 8370 8000  *W* www.lisasoft.com  *F *(+61) 3 8370 8099


On Fri, Nov 28, 2014 at 3:25 PM, Tatsuo Ishii <ishii at postgresql.org> wrote:

> Yes. If "standby" is specified by the parameter, pgpool-II will choose
> one of standby nodes taking consideration of "weight" paramter.
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
> > Oh!
> >
> > Could this new setting be used to achieve my previous example?
> >
> > So have read weights for all, and use this?
> >
> > Cheers,
> >
> >
> > James Sewell,
> > PostgreSQL Team Lead / Solutions Architect
> > ______________________________________
> >
> >
> >  Level 2, 50 Queen St, Melbourne VIC 3000
> >
> > *P *(+61) 3 8370 8000  *W* www.lisasoft.com  *F *(+61) 3 8370 8099
> >
> >
> > On Tue, Nov 25, 2014 at 11:57 AM, Tatsuo Ishii <ishii at postgresql.org>
> wrote:
> >
> >> BTW from pgpool-II 3.4.0, you could achieve this by using new parameter.
> >>
> >> database_redirect_preference_list = '.*:standby'
> >>
> >> This will redirect all read only SELECTs to the standby (or one of
> >> standbys if you have multiple of them) regardless of the physical node
> >> id of primary.
> >>
> >> Best regards,
> >> --
> >> Tatsuo Ishii
> >> SRA OSS, Inc. Japan
> >> English: http://www.sraoss.co.jp/index_en.php
> >> Japanese:http://www.sraoss.co.jp
> >>
> >> > Well I think the real problem here is, the configuration of weight is
> >> > bound to physical node. Ideally the weight should be bound to the
> >> > "logical" or "role" of the node: primary (master) or standbye (slave).
> >> > This way, you don't need to change the weight parameter after role of
> >> > the nodes are swapped. What do you think?
> >> >
> >> > Best regards,
> >> > --
> >> > Tatsuo Ishii
> >> > SRA OSS, Inc. Japan
> >> > English: http://www.sraoss.co.jp/index_en.php
> >> > Japanese:http://www.sraoss.co.jp
> >> >
> >> >> Hello,
> >> >>
> >> >> This method works well, but doesn't really play nicely with our use
> of
> >> >> Puppet (which manages the config files).
> >> >>
> >> >> Would anyone support looking into a pcp command to change this? I may
> >> have
> >> >> some time early in the new year to have a go at an implementation.
> >> >>
> >> >> I was thinking a very simple:
> >> >>
> >> >> pcp_node_weight timeout hostname port# username password nodeID
> >> newweight
> >> >>
> >> >> Maybe there is a reason this won't work / isn't a good idea though?
> >> >>
> >> >> Cheers,
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> James Sewell,
> >> >> PostgreSQL Team Lead / Solutions Architect
> >> >> ______________________________________
> >> >>
> >> >>
> >> >>  Level 2, 50 Queen St, Melbourne VIC 3000
> >> >>
> >> >> *P *(+61) 3 8370 8000  *W* www.lisasoft.com  *F *(+61) 3 8370 8099
> >> >>
> >> >>
> >> >> On Tue, Jul 15, 2014 at 5:38 PM, Tatsuo Ishii <ishii at postgresql.org>
> >> wrote:
> >> >>
> >> >>> > Hey All,
> >> >>> >
> >> >>> > I have two nodes setup like so:
> >> >>> >
> >> >>> >    - Node 1: Master, weight 0
> >> >>> >    - Node 2: Slave, weight 1
> >> >>> >
> >> >>> > This allows me to send all writes to the master and all reads to
> the
> >> >>> slave.
> >> >>> >
> >> >>> > At some stage I promote the slave to be the new master
> (pcp_promote
> >> with
> >> >>> > DISALLOW_TO_FAILOVER), then at some stage later re-provision the
> >> master
> >> >>> as
> >> >>> > a new slave and re-connect it (pcp_enable)
> >> >>> >
> >> >>> > I now have the following setup:
> >> >>> >
> >> >>> >    - Node 1: Slave, weight 0
> >> >>> >    - Node 2: Master, weight 1
> >> >>> >
> >> >>> > This means that all write and read queries are serviced by the new
> >> >>> master,
> >> >>> > and none by the new slave.
> >> >>> >
> >> >>> > Is there a way around this? If there isn't currently could a pcp
> >> command
> >> >>> be
> >> >>> > implemented which would allow me to manage my own weights?
> >> >>>
> >> >>> You could change weight parameters in pgpool.conf then reload it.
> >> >>>
> >> >>> Best regards,
> >> >>> --
> >> >>> Tatsuo Ishii
> >> >>> SRA OSS, Inc. Japan
> >> >>> English: http://www.sraoss.co.jp/index_en.php
> >> >>> Japanese:http://www.sraoss.co.jp
> >> >>>
> >> >>> > Cheers,
> >> >>> >
> >> >>> >
> >> >>> >
> >> >>> > James Sewell,
> >> >>> > PostgreSQL Team Lead / Solutions Architect
> >> >>> > ______________________________________
> >> >>> >
> >> >>> >
> >> >>> >  Level 2, 50 Queen St, Melbourne VIC 3000
> >> >>> >
> >> >>> > *P *(+61) 3 8370 8000  *W* www.lisasoft.com  *F *(+61) 3 8370
> 8099
> >> >>> >
> >> >>> > --
> >> >>> >
> >> >>> >
> >> >>> > ------------------------------
> >> >>> > The contents of this email are confidential and may be subject to
> >> legal
> >> >>> or
> >> >>> > professional privilege and copyright. No representation is made
> that
> >> this
> >> >>> > email is free of viruses or other defects. If you have received
> this
> >> >>> > communication in error, you may not copy or distribute any part of
> >> it or
> >> >>> > otherwise disclose its contents to anyone. Please advise the
> sender
> >> of
> >> >>> your
> >> >>> > incorrect receipt of this correspondence.
> >> >>>
> >> >>
> >> >> --
> >> >>
> >> >>
> >> >> ------------------------------
> >> >> The contents of this email are confidential and may be subject to
> legal
> >> or
> >> >> professional privilege and copyright. No representation is made that
> >> this
> >> >> email is free of viruses or other defects. If you have received this
> >> >> communication in error, you may not copy or distribute any part of
> it or
> >> >> otherwise disclose its contents to anyone. Please advise the sender
> of
> >> your
> >> >> incorrect receipt of this correspondence.
> >> > _______________________________________________
> >> > pgpool-general mailing list
> >> > pgpool-general at pgpool.net
> >> > http://www.pgpool.net/mailman/listinfo/pgpool-general
> >>
> >
> > --
> >
> >
> > ------------------------------
> > The contents of this email are confidential and may be subject to legal
> or
> > professional privilege and copyright. No representation is made that this
> > email is free of viruses or other defects. If you have received this
> > communication in error, you may not copy or distribute any part of it or
> > otherwise disclose its contents to anyone. Please advise the sender of
> your
> > incorrect receipt of this correspondence.
>

-- 


------------------------------
The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this 
email is free of viruses or other defects. If you have received this 
communication in error, you may not copy or distribute any part of it or 
otherwise disclose its contents to anyone. Please advise the sender of your 
incorrect receipt of this correspondence.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20141201/74920ab1/attachment.html>


More information about the pgpool-general mailing list