<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 14pt; color: #000000'>Tatsuo, when pgpool needs to send query to system catalogs on primary to analyze user queries?<br><br>What is the relation of this behavior with the configuration parameter relcache_expire?<br><br>Regards.<br><br><br><br><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">&gt; On Mon, May 21, 2012 at 6:13 PM, Lonni J Friedman &lt;netllama@gmail.com&gt; wrote:<br>&gt;&gt; On Mon, May 21, 2012 at 5:24 PM, Tatsuo Ishii &lt;ishii@postgresql.org&gt; wrote:<br>&gt;&gt;&gt;&gt; On Mon, May 21, 2012 at 3:57 PM, Tatsuo Ishii &lt;ishii@postgresql.org&gt; wrote:<br>&gt;&gt;&gt;&gt;&gt;&gt; Greetings,<br>&gt;&gt;&gt;&gt;&gt;&gt; I'm running pgpool-II-3.1.2 purely for load balancing in front of a 4<br>&gt;&gt;&gt;&gt;&gt;&gt; node postgresql-9.1.3 cluster (all running on Linux-x86_64). &nbsp;I'm<br>&gt;&gt;&gt;&gt;&gt;&gt; using streaming replication with 3 hot standby servers. &nbsp;I have the<br>&gt;&gt;&gt;&gt;&gt;&gt; weighting distributed such that the master weight is set to '1' and<br>&gt;&gt;&gt;&gt;&gt;&gt; the three standby servers are set to '33' each. &nbsp;My intent was that<br>&gt;&gt;&gt;&gt;&gt;&gt; this would nearly eliminate all read queries going to the master,<br>&gt;&gt;&gt;&gt;&gt;&gt; however what I'm observing is that the overall performance seems to be<br>&gt;&gt;&gt;&gt;&gt;&gt; bottlenecked by the performance of the master, even when queries<br>&gt;&gt;&gt;&gt;&gt;&gt; aren't ultimately getting sent to the master.<br>&gt;&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;&gt; For example, there are times when the load on the master is much<br>&gt;&gt;&gt;&gt;&gt;&gt; higher than on the standby servers, and the master's overall<br>&gt;&gt;&gt;&gt;&gt;&gt; performance is noticeably degraded. &nbsp;When this occurs, I've found that<br>&gt;&gt;&gt;&gt;&gt;&gt; establishing a database connection through pgpool with a SQL query<br>&gt;&gt;&gt;&gt;&gt;&gt; that should normally go to one of the standby servers has very poor<br>&gt;&gt;&gt;&gt;&gt;&gt; performance. &nbsp;It seems like pgpool is silently doing something with<br>&gt;&gt;&gt;&gt;&gt;&gt; the master (which is under load and slower to respond), before passing<br>&gt;&gt;&gt;&gt;&gt;&gt; the query itself off to a standby server.<br>&gt;&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;&gt; Is this expected behavior?<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; Yes. Pgpool needs to send query to system catalogs on primary to<br>&gt;&gt;&gt;&gt;&gt; analyze user queries (for example, if the refereed table is a<br>&gt;&gt;&gt;&gt;&gt; temporary table or not).<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Thanks, that's good to know, but also disappointing. &nbsp;This behavior is<br>&gt;&gt;&gt;&gt; serving as a huge bottleneck in my environment. &nbsp;It basically means<br>&gt;&gt;&gt;&gt; that no standby server can respond any faster than the master, which<br>&gt;&gt;&gt;&gt; defeats much of the benefit of load balancing.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Is there any way to work around this, or mitigate it to some degree?<br>&gt;&gt;&gt;&gt; For example, I'm not using temp tables for anything in my environment,<br>&gt;&gt;&gt;&gt; so not performing that check wouldn't have any impact on me.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I thought the access to system catalogs are not big pain because<br>&gt;&gt;&gt; pgpool has session life time caches for this. However it seems they<br>&gt;&gt;&gt; might be bottle neck in your case. I would like to know what kind of<br>&gt;&gt;&gt; quries are major bottle neck in your case. Could you show me the query<br>&gt;&gt;&gt; log on the primary?<br>&gt;&gt;<br>&gt;&gt; I don't have a query log, as we're not logging queries. &nbsp;I guess I<br>&gt;&gt; could enable query logging in pgpool if you think that's going to help<br>&gt;&gt; you investigate this further, but I'm concerned that's going to create<br>&gt;&gt; significant disk activity on the pgpool server.<br>&gt;&gt;<br>&gt;&gt; But the issue isn't that specific queries are a bottleneck but rather<br>&gt;&gt; that if there's a large amount of write activity, the load on the<br>&gt;&gt; master will be much greater than on the standby/slaves, thereby<br>&gt;&gt; reducing the performance of both the master &amp; the standby/slaves.<br>&gt; <br>&gt; Does the lack of reply mean that I'm basically out of luck on this?<br>&gt; Personally, I see this behavior as a significant flaw in pgpool's<br>&gt; design. &nbsp;Its not true load balancing if every query is gated by the<br>&gt; performance of 1 server.<br><br>Any idea how to solve this?<br>--<br>Tatsuo Ishii<br>SRA OSS, Inc. Japan<br>English: http://www.sraoss.co.jp/index_en.php<br>Japanese: http://www.sraoss.co.jp<br>_______________________________________________<br>pgpool-general mailing list<br>pgpool-general@pgpool.net<br>http://www.pgpool.net/mailman/listinfo/pgpool-general<br><br>10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...<br>CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION<br><br>http://www.uci.cu<br>http://www.facebook.com/universidad.uci<br>http://www.flickr.com/photos/universidad_uci<br></blockquote><br></div></body>
<br><html>
<body>
<a href="http://www.uci.cu/">
<img src="http://universidad.uci.cu/email.gif"/>
</body>
</html>

<br></html>