<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Calibri">Thanks for the answers.<br>
I'll check if we can make some resources available to work on the
"doable" code.<br>
<br>
</font>
<div class="moz-cite-prefix">On 26-03-14 08:12, Tatsuo Ishii wrote:<br>
</div>
<blockquote
cite="mid:20140326.161222.2195137915061204276.t-ishii@sraoss.co.jp"
type="cite">
<blockquote type="cite">
<pre wrap="">Is it possible to change the behaviour of handling of client connections
when more than num_init_children try to connect?
</pre>
</blockquote>
<pre wrap="">
No.
</pre>
<blockquote type="cite">
<pre wrap="">We have a number of
applications using a drop wizard connection pool to connect to the pgpool-II
cluster. In an ideal situation these applications would be sized to the
maximum amount of available connection, but as said, this would be an ideal
situation. In real life, some of these application try to allocate more
connections then available, but instead of a connection error the
application pool just waits for the connection to become active. As such,
one misconfigured application can hold all the connections of the pool,
blocking all other applications.
It would be great if we could mimic the standard postgresql rejection
</pre>
</blockquote>
<pre wrap="">
This behavior can be emulated by setting:
fail_over_on_backend_error = off
backend_flag0 = 'DISALLOW_TO_FAILOVER'
health_check_period = 0
and set num_init_children > max_connections.
Unfortunately you cannot use the failover feature of pgpool-II though.
</pre>
<blockquote type="cite">
<pre wrap="">or
even better, put some timeout value for the queued connections.
</pre>
</blockquote>
<pre wrap="">
This is not possible because the queue is inside the kernel. There's
no API to control the timeout in the queue.
</pre>
<blockquote type="cite">
<pre wrap="">For
instance, queue a new connection if no available pool processes for x time,
reject after x time if no processes are freed to handle the queued
connection. As such, the application pool would know that the extra
connection didn't succeed and would pool the request to one of the already
open connections.
An even better way of coping with this would be to be able to limit the
amount of connections per user/database/ip.
</pre>
</blockquote>
<pre wrap="">
This is doable (with moderate amount of codes).
</pre>
<blockquote type="cite">
<pre wrap="">I still need to test what
happens if you put a user limit in postgresql, for example, if you put a
connection limit of 4 for user test on postgresql level, what happens if you
try to open 5 connections to the pgpool with some processes left to handle
connections. Does it reject the connection or does it queue it?
Regards,
Sam
</pre>
</blockquote>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<font face="Verdana"><font color="#666666"><small>Sam Wouters<br>
Ericom Computers</small></font><br>
</font><font color="#cccccc"><tt>--------------------------------------------------</tt></font><br>
<table height="50" border="0" cellpadding="2" cellspacing="2"
width="400">
<tbody>
<tr>
<td valign="top" width="150"><font color="#666666"><small><small><small><font
face="Verdana"><big><b><font color="#666666">Ericom
Computers</font></b></big><br>
Tiensestraat 178<br>
3000 Leuven<br>
<font color="#999999"><br>
</font></font></small></small></small></font><font
color="#999999"><small><small><small><font
face="Verdana">Tel : +32 (0) 16 23 77 55<br>
Fax : +32 (0) 16 23 48 05</font></small></small></small></font><br>
</td>
<td align="center" valign="top" width="200"><a
href="http://www.ericom.be"><img alt="Ericom Website"
src="cid:part1.07060300.06030801@ericom.be"
height="52" border="0" width="200"></a><br>
<b><small><small><small><font face="Verdana"><br>
<font color="#999999"><a
href="http://www.ericom.be">http://www.ericom.be</a></font></font></small></small></small></b><br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
<br>
</div>
</body>
</html>