[pgpool-hackers: 445] Re: Regarding backlog parameter for listen()
Tatsuo Ishii
ishii at postgresql.org
Tue Jan 7 14:26:03 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?
No. We just copied the idea from PostgreSQL, which was a bad decision
I think.
> 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.
Actually I thought about similar idea as yours. However mine is more
straightforward like Apache's "ListenBackLog", which is simply the
listen's backlog number. I think your idea is better than mine, in
that there's less possiblity for users to set conflicting parameter
for num_init_children and "ListenBackLog" (imagine stupid user could
set num_init_children = 20 and listenbacklog = 10).
So I'm leaning to your idea.
Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
More information about the pgpool-hackers
mailing list