This is almost same algorithm as PostgreSQL.
I hope pgpool-II does not consume so much system resource any more...
int status;
int one = 1;
int len;
+ int backlog;
fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd == -1)
myexit(1);
}
- status = listen(fd, PGPOOLMAXLITSENQUEUELENGTH);
+ backlog = pool_config->num_init_children * 2;
+ if (backlog > PGPOOLMAXLITSENQUEUELENGTH)
+ backlog = PGPOOLMAXLITSENQUEUELENGTH;
+
+ status = listen(fd, backlog);
if (status < 0)
{
pool_error("listen() failed. reason: %s", strerror(errno));