<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.Stylwiadomocie-mail17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=PL link=blue vlink=blue>

<div class=Section1>

<div>

<div>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>Check for memory leaks, it&#8217;s possible in
solaris. Maybe after few hours the amount of ram used by pgpool processes is </span></font><span
lang=EN-US>significantly greater?<o:p></o:p></span></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>My suggest is to observe ram/swap usage and size
of pgpool proceesses while it&#8217;s running, maybe size of the processes
grows in time.<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;line-height:
120%'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
face="Times New Roman"><span style='font-size:12.0pt;line-height:120%'>Although</span></font><span
lang=EN-US>, I have configuration:<o:p></o:p></span></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>num_init_children = 100<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>max_pool = 5<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>Pgpool 3.1.3 on solaris 10 (x86) and did not
encounter any problems with memory leaks.<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>Did you have any other software running on server
with pgpool? Is this physical server or virtual machine? What is your solaris
version?<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>Regards,<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'>Rafal<o:p></o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=3
color=navy face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;
line-height:120%;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='line-height:120%;vertical-align:middle'><font size=1
color="#333333" face=Calibri><span lang=EN-US style='font-size:6.0pt;
line-height:120%;font-family:Calibri;color:#333333'><o:p>&nbsp;</o:p></span></font></p>

</div>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
caravinth@gmail.com [mailto:caravinth@gmail.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Aravinth<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, June 29, 2012 11:14
AM<br>
<b><span style='font-weight:bold'>To:</span></b> Kuczynski, Rafal (LNG-POL)<br>
<b><span style='font-weight:bold'>Cc:</span></b> <st1:PersonName w:st="on">pgpool-general@pgpool.net</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [pgpool-general: 677]
Re: strange load balancing issue in Solaris</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Hi Rafal,<br>
<br>
The total RAM size is 16GB. Also pgpool was able to handle 300 connection for a
few hours.<br>
<br>
I have the same setup in centos machine with less RAM that runs without any
issues. The issue is only in solaris.<br>
<br>
Any thoughts..<br>
<br>
<br clear=all>
Regards,<br>
Aravinth<br>
<br>
<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Fri, Jun 29, 2012 at 2:34 PM, Kuczynski, Rafal (LNG-POL) &lt;<a
href="mailto:Rafal.Kuczynski@lexisnexis.pl" target="_blank">Rafal.Kuczynski@lexisnexis.pl</a>&gt;
wrote:<o:p></o:p></span></font></p>

<div link=blue vlink=blue>

<div>

<div>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt;line-height:120%'>&gt; 2012-06-07 08:31:17
ERROR: pid 927: fork() failed. reason: Not enough space</span><o:p></o:p></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt;line-height:120%'>&nbsp;</span><o:p></o:p></font></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt;line-height:120%'>This means you have ran
out of ram/swap space. Either you r server doesn&#8217;t have enough ram for
300 processes of pgpool, or you have problem with memory leaks.</span><o:p></o:p></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt;line-height:120%'>You have to monitor
ram/swap usage while pgpool is working.</span><o:p></o:p></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt;line-height:120%'>&nbsp;</span><o:p></o:p></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt;line-height:120%'>Regards,</span><o:p></o:p></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt;line-height:120%'>Rafal</span><o:p></o:p></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt;line-height:120%'>&nbsp;</span><o:p></o:p></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 color=navy
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;line-height:
120%;color:navy'>&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
line-height:120%;vertical-align:middle'><font size=3 color=navy
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt;line-height:
120%;color:navy'>&nbsp;</span></font><o:p></o:p></p>

</div>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center>

</span></font></div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;font-weight:
bold'>From:</span></font></b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma'> <a href="mailto:pgpool-general-bounces@pgpool.net"
target="_blank">pgpool-general-bounces@pgpool.net</a> [mailto:<a
href="mailto:pgpool-general-bounces@pgpool.net" target="_blank">pgpool-general-bounces@pgpool.net</a>]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Aravinth<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, June 29, 2012 10:51
AM<br>
<b><span style='font-weight:bold'>To:</span></b> Tatsuo Ishii<br>
<b><span style='font-weight:bold'>Cc:</span></b> <a
href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
<b><span style='font-weight:bold'>Subject:</span></b> [pgpool-general: 674] Re:
strange load balancing issue in Solaris</span></font><o:p></o:p></p>

</div>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>Guys,<br>
<br>
I am facing another issue in same solaris.<br>
<br>
I have initialized 300 pre-forked connections using num_init_childresn in
streaming replication mode. Every thing works perfectly for a few hours.<br>
<br>
After a few hours the connections drop with the below error . Also pgpool
doesn't allow any new connections. <br>
<br>
Any ideas guys.....<br>
<br>
<br>
<br>
<br>
2012-06-07 08:31:15 DEBUG: pid 927: fork a new child pid 1645<br>
2012-06-07 08:31:15 DEBUG: pid 927: child 1413 exits with status 1 by signal 1<br>
2012-06-07 08:31:15 DEBUG: pid 1645: I am 1645<br>
2012-06-07 08:31:15 DEBUG: pid 1645: pool_initialize_private_backend_status:
initialize backend status<br>
2012-06-07 08:31:15 DEBUG: pid 927: fork a new child pid 1646<br>
2012-06-07 08:31:15 DEBUG: pid 927: child 1410 exits with status 1 by signal 1<br>
2012-06-07 08:31:15 DEBUG: pid 1646: I am 1646<br>
2012-06-07 08:31:15 DEBUG: pid 1646: pool_initialize_private_backend_status:
initialize backend status<br>
2012-06-07 08:31:17 ERROR: pid 927: fork() failed. reason: Not enough space<br>
2012-06-07 08:31:17 DEBUG: pid 2012-06-07 08:31:172012-06-07
08:31:1716382012-06-07 08:31:172012-06-07 08:31:17 DEBUG: pid 2012-06-07
08:31:172012-06-07 08:31:172012-06<br>
-07 08:31:17 DEBUG: pid 2012-06-07 08:31:172012-06-07 08:31:172012-06-07
08:31:172012-06-07 08:31:17: 2012-06-07 08:31:172012-06-07 08:31:172012-06-07
08:31:172012-06-0<br>
7 08:31:172012-06-07 08:31:172012-06-07 08:31:17 DEBUG: pid 2012-06-07
08:31:172012-06-07 08:31:172012-06-07 08:31:172012-06-07 08:31:172012-06-07
08:31:172012-06-07 08<br>
:31:172012-06-07 08:31:17 DEBUG: pid 2012-06-07 08:31:172012-06-07
08:31:172012-06-07 08:31:172012-06-07 08:31:1716402012-06-07 08:31:172012-06-07
08:31:17 DEBUG: pid 2<br>
012-06-07 08:31:172012-06-07 08:31:172012-06-07 08:31:172012-06-07
08:31:172012-06-07 08:31:17 DEBUG: pid&nbsp; DEBUG: pid 1637 DEBUG: pid&nbsp;
DEBUG: pid&nbsp; DEBUG: pid&nbsp; DEBUG: pi<br>
d child received shutdown request signal&nbsp; DEBUG: pid&nbsp; DEBUG:
pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid 1641
DEBUG: pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid&nbsp; DE<br>
BUG: pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid 1642 DEBUG: pid&nbsp; DEBUG:
pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid :&nbsp; DEBUG: pid&nbsp; DEBUG: pid 1636
DEBUG: pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid&nbsp; DEBUG: pid&nbsp; DEBU<br>
G: pid 16341646: 163016351629163115163316431628164516441639:
1632162716251617161516261610: 1614162216181613child received shutdown request
signal 16191612: 161116231621<br>
16241620: : child received shutdown request signal : : : :<br>
: : : : : : child received shutdown request signal : : : : : : : child received
shutdown request signal : : : : 15: : child received shutdown request signal :
: : : : child received shutdown request signal child received shutdown request
signal 15child received shutdown request signal child received shutdown request
signal child received shutdown request signal child received shutdown request
signal child received shutdown request signal child received shutdown request
signal child received shutdown request signal child received shutdown request
signal child received shutdown request signal child received shutdown request
signal 15child received shutdown request signal child received shutdown request
signal child received shutdown request signal child received shutdown request
signal child received shutdown request signal child received shutdown request
signal child received shutdown request signal 15child received shutdown request
signal child received shutdown request signal child received shutdown request
signal child received shutdown request signal<br>
child received shutdown request signal child received shutdown request signal
15child received shutdown request signal child received shutdown request signal
child received shutdown request signal child received shutdown request signal
child received shutdown request signal 1515<br>
15151515151515151515<br>
15151515151515<br>
151515151515<br>
1515151515<br>
<br>
<br>
&nbsp;<br clear=all>
Regards,<br>
Aravinth<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>On Thu, May 10,
2012 at 8:15 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org"
target="_blank">ishii@postgresql.org</a>&gt; wrote:<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>Good. Fix
committed in master/V3_1_STABLE/V3_0_STABLE.<o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>--<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>
&gt; It's working.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Aravinth<br>
&gt;<br>
&gt;<br>
&gt; On Wed, May 9, 2012 at 5:26 PM, Tatsuo Ishii &lt;<a
href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;
wrote:<br>
&gt;<br>
&gt;&gt; Thanks for the hint. Attached is a patch trying to fix the<br>
&gt;&gt; problem. Can you please try it?<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; Yes the issue is with random() function.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Looks like I have solved the problem by using rand.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt; Aravinth<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Wed, May 9, 2012 at 4:02 PM, Tatsuo Ishii &lt;<a
href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; Thanks. Apparently random() of Solaris could return value
beyond<br>
&gt;&gt; &gt;&gt; RAND_MAX! It's easy to fix the problem, but I would like to
do it with<br>
&gt;&gt; &gt;&gt; respcet to portability. Any idea?<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; SRA OSS, Inc. Japan<br>
&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; Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;From Solaris 10 (x86) man page:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; SYNOPSIS<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;#include &lt;stdlib.h&gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;long random(void);<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;void srandom(unsigned int seed);<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;char &nbsp;*initstate(unsigned
&nbsp;int &nbsp;seed, &nbsp;char &nbsp;*state, &nbsp;size_t<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;size);<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;char *setstate(const char *state);<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; DESCRIPTION<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;The random() function uses &nbsp;a
&nbsp;nonlinear &nbsp;additive &nbsp;feedback<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;random-number generator employing a
default state array size<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;of 31 &nbsp;long &nbsp;integers
&nbsp;to &nbsp;return &nbsp;successive &nbsp;pseudo-random<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;numbers &nbsp;in the range from 0 to
2**31 -1. The period of this<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;random-number generator is
approximately 16 x (2 **31 &nbsp; -1).<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;The &nbsp;size &nbsp;of &nbsp;the
&nbsp;state array determines the period of the<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;random-number generator. Increasing
&nbsp;the &nbsp;state &nbsp;array &nbsp;size<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;increases the period.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;The srandom() function initializes
the current &nbsp;state &nbsp;array<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp;using the value of seed.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; (...)<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt;&gt; &gt; Rafal<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; -----Original Message-----<br>
&gt;&gt; &gt;&gt; &gt; From: <a href="mailto:pgpool-general-bounces@pgpool.net"
target="_blank">pgpool-general-bounces@pgpool.net</a> [mailto:<br>
&gt;&gt; &gt;&gt; <a href="mailto:pgpool-general-bounces@pgpool.net"
target="_blank">pgpool-general-bounces@pgpool.net</a>] On Behalf Of Tatsuo
Ishii<br>
&gt;&gt; &gt;&gt; &gt; Sent: Wednesday, May 09, 2012 11:44 AM<br>
&gt;&gt; &gt;&gt; &gt; To: <a href="mailto:caravinth@gmail.com" target="_blank">caravinth@gmail.com</a><br>
&gt;&gt; &gt;&gt; &gt; Cc: <a href="mailto:pgpool-general@pgpool.net"
target="_blank">pgpool-general@pgpool.net</a><br>
&gt;&gt; &gt;&gt; &gt; Subject: [pgpool-general: 431] Re: strange load
balancing issue in<br>
&gt;&gt; &gt;&gt; Solaris<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Thanks.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 2012-05-09 14:31:48 LOG: &nbsp; pid 22459: r:
268356063.000000<br>
&gt;&gt; total_weight:<br>
&gt;&gt; &gt;&gt; 32767.000000<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; This is really weird. Here pgpool caculate this:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; r = (((double)random())/RAND_MAX) *
total_weight;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Total weight is same as RAND_MAX. &nbsp;It seems your
random() returns<br>
&gt;&gt; &gt;&gt; &gt; bigger than RAND_MAX, which does not make sense because
man page of<br>
&gt;&gt; &gt;&gt; &gt; random(3) on my Linux says:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;The random() function
uses a non-linear additive feedback<br>
&gt;&gt; &gt;&gt; random number<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;generator &nbsp;employing a
default table of size 31 long integers<br>
&gt;&gt; to<br>
&gt;&gt; &gt;&gt; return<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;successive pseudo-random
numbers in the range from 0 to<br>
&gt;&gt; RAND_MAX.<br>
&gt;&gt; &gt;&gt; &nbsp; The<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;period &nbsp;of &nbsp;this
&nbsp;random &nbsp;number generator is very large,<br>
&gt;&gt; &gt;&gt; approximately<br>
&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;16 * ((2^31) - 1).<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; What does your man page for random() say on your system?<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; Sorry . I missed it.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Here is the log file.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; --Aravinth<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; On Wed, May 9, 2012 at 2:07 PM, Tatsuo Ishii &lt;<a
href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; The code you have sent is same in child.c.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; No.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;pool_log(&quot;r: %f
total_weight: %f&quot;, r, total_weight);<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; You need to add the line above to get usefull
information.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &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;&gt;&gt; Japanese: <a href="http://www.sraoss.co.jp"
target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; I have attached the log file. Please check<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; --Aravinth<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; On Tue, May 8, 2012 at 6:20 AM, Tatsuo
Ishii &lt;<br>
&gt;&gt; <a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; I suspect there's some portablity issue
with load balance code.<br>
&gt;&gt; The<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; actual source code is in
select_load_balancing_nodechild.c).<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Please modify source code and connect
to pgpool by using psql.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Please send the log output.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt; &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;&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;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; int select_load_balancing_node(void)<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; {<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;int
selected_slot;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;double
total_weight,r;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;int i;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;/* choose a
backend in random manner with weight */<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp;
&nbsp;selected_slot = MASTER_NODE_ID;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;total_weight
= 0.0;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;for
(i=0;i&lt;NUM_BACKENDS;i++)<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;if (VALID_BACKEND(i))<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;{<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;total_weight +=<br>
&gt;&gt; &gt;&gt; BACKEND_INFO(i).backend_weight;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;}<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;r =
(((double)random())/RAND_MAX) * total_weight;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp;
&nbsp;pool_log(&quot;r: %f total_weight: %f&quot;, r, total_weight);<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &nbsp;&lt;--<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; add this<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;total_weight
= 0.0;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;for
(i=0;i&lt;NUM_BACKENDS;i++)<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;if (VALID_BACKEND(i) &amp;&amp;<br>
&gt;&gt; &gt;&gt; BACKEND_INFO(i).backend_weight &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; 0.0)<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;{<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(r &gt;= total_weight)<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;selected_slot = i;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;break;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;total_weight +=<br>
&gt;&gt; &gt;&gt; BACKEND_INFO(i).backend_weight;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; }<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp;
&nbsp;pool_debug(&quot;select_load_balancing_node: selected backend<br>
&gt;&gt; id<br>
&gt;&gt; &gt;&gt; is<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; %d&quot;,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; selected_slot);<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; return
selected_slot;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; }<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Hi Tatsuo, Thanks for the reply.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; The normalized weights are 0.5 for
both nodes and the selected<br>
&gt;&gt; &gt;&gt; node is<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; always the same node. I hope then it's
srandom().<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Any idea to solve this srandom
issue<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Thanks and Regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Aravinth<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; ________________________________<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; &nbsp;From: Tatsuo Ishii &lt;<a
href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; To: <a
href="mailto:aravinth@mafiree.com" target="_blank">aravinth@mafiree.com</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Cc: <a
href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Sent: Tuesday, May 1, 2012 4:41 AM<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Subject: Re: [pgpool-general: 396]
strange load balancing<br>
&gt;&gt; issue in<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Solaris<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; First of all please check
&quot;normalized&quot; weights are as you<br>
&gt;&gt; &gt;&gt; expected.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Run &quot;show pool_status;&quot;
and see &quot;backend_weight0&quot;,<br>
&gt;&gt; &gt;&gt; &quot;backend_weight1&quot;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; section. You see a floating point
numbers, which are the<br>
&gt;&gt; &gt;&gt; normalized<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; weight between 0.0 and 1.0. If you
see both are 0.5, primary<br>
&gt;&gt; and<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; standby are given same weight.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; If they are ok, I suspect
srandom() function behavior is<br>
&gt;&gt; different<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; from other platforms. Pgpool-II
chooses the load balance node<br>
&gt;&gt; by<br>
&gt;&gt; &gt;&gt; using<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; srandom().
select_load_balancing_node() is the function which<br>
&gt;&gt; is<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; responsible for selecting the load
balance node. If you run<br>
&gt;&gt; &gt;&gt; pgpool-II<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; with -d (debug) option, you will
see following in the log:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; &nbsp; &nbsp;
pool_debug(&quot;select_load_balancing_node: selected backend<br>
&gt;&gt; id is<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; %d&quot;,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; selected_slot);<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; If backend_weight in show
pool_status are fine but the line<br>
&gt;&gt; above<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; always shows same number, it is
the sign that we have problem<br>
&gt;&gt; with<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; srandom().<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt; &gt;&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;&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;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Hi All,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; I am facing a strange issue in
load balancing with replication<br>
&gt;&gt; &gt;&gt; mode<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; set<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; true in Solaris. Load balancing
algorithm always select the<br>
&gt;&gt; same<br>
&gt;&gt; &gt;&gt; node<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; whatever may be the backend
weight<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Here is the scenario.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; I have a pgpool installed
installed in 1 server<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; 2 postgres nodes in other 2
servers<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; replication mode set to true
and load balancing set to true<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; backend weight of the 2 nodes
is 1.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; When I fire the queries
manuall using different connections or<br>
&gt;&gt; &gt;&gt; using<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; pgbench all the queries hit
the same node. Load balancing<br>
&gt;&gt; &gt;&gt; algorithm<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; always<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; select the same node.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; No effect in changing the
backend weight. Only when I set<br>
&gt;&gt; backend<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; weight to<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; 0 hits go to the other server.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; I face this issue only in
solaris. The same setup in other<br>
&gt;&gt; &gt;&gt; servers (<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; centos<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; ,RHEL, ubunt etc) does the
load balancing perfectly.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Also tries various postgres
versions and pgpool version with<br>
&gt;&gt; same<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; result.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; But every version runs fine in
other servers.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Has anyone faced this issue?<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Any information would highly
helpful.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Aravinth<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;
_______________________________________________<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; pgpool-general mailing list<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; <a
href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&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; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt; pgpool-general mailing list<br>
&gt;&gt; &gt;&gt; &gt; <a href="mailto:pgpool-general@pgpool.net"
target="_blank">pgpool-general@pgpool.net</a><br>
&gt;&gt; &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; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; &gt; pgpool-general mailing list<br>
&gt;&gt; &gt;&gt; &gt; <a href="mailto:pgpool-general@pgpool.net"
target="_blank">pgpool-general@pgpool.net</a><br>
&gt;&gt; &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; &gt;&gt; _______________________________________________<br>
&gt;&gt; &gt;&gt; pgpool-general mailing list<br>
&gt;&gt; &gt;&gt; <a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
&gt;&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; &gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; pgpool-general mailing list<br>
&gt;&gt; <a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
&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;&gt;<br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net" target="_blank">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><o:p></o:p></span></font></p>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>