[pgpool-hackers: 443] Regarding backlog parameter for listen()

Junegunn Choi junegunn.c at gmail.com
Tue Jan 7 14:08:00 JST 2014


Hello,

Currently, backlog parameter for listen() call is set to 2 *
num_init_children.

> backlog = pool_config->num_init_children * 2

Is there a specific reason behind this? We're in a situation where we
expect a
large number of concurrent connections, but unable to increase
num_init_children anymore due to memory limitation of the pgpool server and
the
backends.

We've observed on our system that when the number of concurrent connections
exceeds 3 * num_init_children, the extra connections are refused as
expected,
but not immediately but after a few seconds (around 20). So we're not likely
to have a problem even if there are many number of connections, as each one
of them finishes very quickly.

However, we want to make sure that those extra connections are guaranteed to
be queued by pgpool without having to increase num_init_children.

So we've added a parameter called `listen_backlog_multiplier` to our fork
of pgpool,
which replaces the hard-coded number 2 in main.c.

> backlog = pool_config->num_init_children *
pool_config->listen_backlog_multiplier;

So what do you think? Do you think it makes sense? I will not attach the
patch
here, since it's a very simple and straightforward one, and I haven't
properly
documented it.

Thanks.

Junegunn Choi.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20140107/b64614df/attachment.html>


More information about the pgpool-hackers mailing list