<div dir="ltr">Can you combine it with weight?<div><br></div><div>This would allow weight to be the physical capability metric, with <span style="font-size:13px;font-family:arial,sans-serif">database_redirect_preference_</span><span class="" style="font-size:13px;font-family:arial,sans-serif">list</span><span style="font-size:13px;font-family:arial,sans-serif">  handling the logical routing.</span></div><div><br></div><div><font face="arial, sans-serif">so:</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">   </font><font face="monospace">backend0_weight = 2</font></div><div><font face="monospace">  backend1_weight = 2</font></div><div><font face="monospace">  backend2_weight = 1<br></font></div><div><font face="monospace"><span style="font-size:13px">  database_redirect_preference_</span><span class="" style="font-size:13px">list</span><span style="font-size:13px"> = &#39;.*:standby&#39;</span><br></font></div><div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div>Would result in the following:<br></div><div><br></div><div>If node0 master:</div><div><ul><li>node0 = 0% reads (master, weight not used)</li><li>node1 = 66% reads</li><li>node2 = 33% reads</li></ul></div><div><font face="arial, sans-serif">If node2 master</font></div><div><ul><li><font face="arial, sans-serif">node0 = 50% reads</font></li><li><font face="arial, sans-serif">node1 = 50% reads</font></li><li><font face="arial, sans-serif">node2 = 0% reads (master, weight not used)</font></li></ul><div><font face="arial, sans-serif">Is this possible?</font></div></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Cheers,</font></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div style="color:#b8276a;font:bold 14px Arial,Helvetica,sans-serif">
        <br>
        <span style="color:#323b62">James Sewell,</span><br>
        <span style="color:#a9a9a9"><span style="font:12px Arial,Helvetica,sans-serif">PostgreSQL Team Lead / Solutions Architect </span></span><br>
        <span style="color:#a9a9a9">______________________________________</span><br>
         </div>
<img alt="" src="http://www.lisasoft.com/sites/lisasoft/files/u1/logo1.jpg" style="margin:0px;width:153px;height:50px"><br>
<div style="font:normal 12px/20px Arial,Helvetica,sans-serif;color:#404040;margin:0">
        <span style="color:#a9a9a9">Level 2, 50 Queen St, Melbourne VIC 3000</span><br>
        <br>
        <strong>P </strong><span style="color:#a9a9a9"><span style="font-family:Arial,Verdana,sans-serif">(+61) 3 8370 8000</span></span><span style="color:rgb(169,169,169)"> </span><strong> </strong><span style="color:rgb(50,59,98)"><span style="width:15px;display:inline-block"><strong>W</strong></span></span> <a style="color:rgb(64,64,64);margin:2px 0px;text-decoration:none"><span style="color:#a9a9a9">www.lisasoft.com</span></a>  <span style="color:rgb(50,59,98)"><span style="width:15px;display:inline-block"><strong>F </strong></span></span><span style="color:#a9a9a9"><span style="font-family:Arial,Verdana,sans-serif">(+61) 3 8370 8099</span></span></div>
<div style="padding-top:8px">
         </div></div></div>
<br><div class="gmail_quote">On Fri, Nov 28, 2014 at 3:25 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes. If &quot;standby&quot; is specified by the parameter, pgpool-II will choose<br>
one of standby nodes taking consideration of &quot;weight&quot; paramter.<br>
<span class="im HOEnZb"><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
</span><span class="im HOEnZb">&gt; Oh!<br>
&gt;<br>
&gt; Could this new setting be used to achieve my previous example?<br>
&gt;<br>
&gt; So have read weights for all, and use this?<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt;<br>
&gt; James Sewell,<br>
&gt; PostgreSQL Team Lead / Solutions Architect<br>
&gt; ______________________________________<br>
&gt;<br>
&gt;<br>
</span><div class="HOEnZb"><div class="h5">&gt;  Level 2, 50 Queen St, Melbourne VIC 3000<br>
&gt;<br>
&gt; *P *<a href="tel:%28%2B61%29%203%208370%208000" value="+61383708000">(+61) 3 8370 8000</a>  *W* <a href="http://www.lisasoft.com" target="_blank">www.lisasoft.com</a>  *F *<a href="tel:%28%2B61%29%203%208370%208099" value="+61383708099">(+61) 3 8370 8099</a><br>
&gt;<br>
&gt;<br>
&gt; On Tue, Nov 25, 2014 at 11:57 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; BTW from pgpool-II 3.4.0, you could achieve this by using new parameter.<br>
&gt;&gt;<br>
&gt;&gt; database_redirect_preference_list = &#39;.*:standby&#39;<br>
&gt;&gt;<br>
&gt;&gt; This will redirect all read only SELECTs to the standby (or one of<br>
&gt;&gt; standbys if you have multiple of them) regardless of the physical node<br>
&gt;&gt; id of primary.<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;<br>
&gt;&gt; &gt; Well I think the real problem here is, the configuration of weight is<br>
&gt;&gt; &gt; bound to physical node. Ideally the weight should be bound to the<br>
&gt;&gt; &gt; &quot;logical&quot; or &quot;role&quot; of the node: primary (master) or standbye (slave).<br>
&gt;&gt; &gt; This way, you don&#39;t need to change the weight parameter after role of<br>
&gt;&gt; &gt; the nodes are swapped. What do you think?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Best regards,<br>
&gt;&gt; &gt; --<br>
&gt;&gt; &gt; Tatsuo Ishii<br>
&gt;&gt; &gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; &gt; Japanese:<a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; Hello,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; This method works well, but doesn&#39;t really play nicely with our use of<br>
&gt;&gt; &gt;&gt; Puppet (which manages the config files).<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Would anyone support looking into a pcp command to change this? I may<br>
&gt;&gt; have<br>
&gt;&gt; &gt;&gt; some time early in the new year to have a go at an implementation.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I was thinking a very simple:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; pcp_node_weight timeout hostname port# username password nodeID<br>
&gt;&gt; newweight<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Maybe there is a reason this won&#39;t work / isn&#39;t a good idea though?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Cheers,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; James Sewell,<br>
&gt;&gt; &gt;&gt; PostgreSQL Team Lead / Solutions Architect<br>
&gt;&gt; &gt;&gt; ______________________________________<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;  Level 2, 50 Queen St, Melbourne VIC 3000<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; *P *<a href="tel:%28%2B61%29%203%208370%208000" value="+61383708000">(+61) 3 8370 8000</a>  *W* <a href="http://www.lisasoft.com" target="_blank">www.lisasoft.com</a>  *F *<a href="tel:%28%2B61%29%203%208370%208099" value="+61383708099">(+61) 3 8370 8099</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Tue, Jul 15, 2014 at 5:38 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; Hey All,<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; I have two nodes setup like so:<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt;    - Node 1: Master, weight 0<br>
&gt;&gt; &gt;&gt;&gt; &gt;    - Node 2: Slave, weight 1<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; This allows me to send all writes to the master and all reads to the<br>
&gt;&gt; &gt;&gt;&gt; slave.<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; At some stage I promote the slave to be the new master (pcp_promote<br>
&gt;&gt; with<br>
&gt;&gt; &gt;&gt;&gt; &gt; DISALLOW_TO_FAILOVER), then at some stage later re-provision the<br>
&gt;&gt; master<br>
&gt;&gt; &gt;&gt;&gt; as<br>
&gt;&gt; &gt;&gt;&gt; &gt; a new slave and re-connect it (pcp_enable)<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; I now have the following setup:<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt;    - Node 1: Slave, weight 0<br>
&gt;&gt; &gt;&gt;&gt; &gt;    - Node 2: Master, weight 1<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; This means that all write and read queries are serviced by the new<br>
&gt;&gt; &gt;&gt;&gt; master,<br>
&gt;&gt; &gt;&gt;&gt; &gt; and none by the new slave.<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; Is there a way around this? If there isn&#39;t currently could a pcp<br>
&gt;&gt; command<br>
&gt;&gt; &gt;&gt;&gt; be<br>
&gt;&gt; &gt;&gt;&gt; &gt; implemented which would allow me to manage my own weights?<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; You could change weight parameters in pgpool.conf then reload it.<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; Best regards,<br>
&gt;&gt; &gt;&gt;&gt; --<br>
&gt;&gt; &gt;&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; &gt;&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; Cheers,<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; James Sewell,<br>
&gt;&gt; &gt;&gt;&gt; &gt; PostgreSQL Team Lead / Solutions Architect<br>
&gt;&gt; &gt;&gt;&gt; &gt; ______________________________________<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt;  Level 2, 50 Queen St, Melbourne VIC 3000<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; *P *<a href="tel:%28%2B61%29%203%208370%208000" value="+61383708000">(+61) 3 8370 8000</a>  *W* <a href="http://www.lisasoft.com" target="_blank">www.lisasoft.com</a>  *F *<a href="tel:%28%2B61%29%203%208370%208099" value="+61383708099">(+61) 3 8370 8099</a><br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; --<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt; &gt; ------------------------------<br>
&gt;&gt; &gt;&gt;&gt; &gt; The contents of this email are confidential and may be subject to<br>
&gt;&gt; legal<br>
&gt;&gt; &gt;&gt;&gt; or<br>
&gt;&gt; &gt;&gt;&gt; &gt; professional privilege and copyright. No representation is made that<br>
&gt;&gt; this<br>
&gt;&gt; &gt;&gt;&gt; &gt; email is free of viruses or other defects. If you have received this<br>
&gt;&gt; &gt;&gt;&gt; &gt; communication in error, you may not copy or distribute any part of<br>
&gt;&gt; it or<br>
&gt;&gt; &gt;&gt;&gt; &gt; otherwise disclose its contents to anyone. Please advise the sender<br>
&gt;&gt; of<br>
&gt;&gt; &gt;&gt;&gt; your<br>
&gt;&gt; &gt;&gt;&gt; &gt; incorrect receipt of this correspondence.<br>
&gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; ------------------------------<br>
&gt;&gt; &gt;&gt; The contents of this email are confidential and may be subject to legal<br>
&gt;&gt; or<br>
&gt;&gt; &gt;&gt; professional privilege and copyright. No representation is made that<br>
&gt;&gt; this<br>
&gt;&gt; &gt;&gt; email is free of viruses or other defects. If you have received this<br>
&gt;&gt; &gt;&gt; communication in error, you may not copy or distribute any part of it or<br>
&gt;&gt; &gt;&gt; otherwise disclose its contents to anyone. Please advise the sender of<br>
&gt;&gt; your<br>
&gt;&gt; &gt;&gt; incorrect receipt of this correspondence.<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; pgpool-general mailing list<br>
&gt;&gt; &gt; <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
&gt;&gt; &gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt;<br>
&gt; ------------------------------<br>
&gt; The contents of this email are confidential and may be subject to legal or<br>
&gt; professional privilege and copyright. No representation is made that this<br>
&gt; email is free of viruses or other defects. If you have received this<br>
&gt; communication in error, you may not copy or distribute any part of it or<br>
&gt; otherwise disclose its contents to anyone. Please advise the sender of your<br>
&gt; incorrect receipt of this correspondence.<br>
</div></div></blockquote></div><br></div>

<br>
<p><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14.545454025268555px;background-color:rgb(255,255,255)"><hr><font size="1" color="Gray" face="Arial">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.</font></div></p>