Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2015 15:38:51 -0700
From:      Charles Swiger <cswiger@mac.com>
To:        David Benfell <benfell@parts-unknown.org>
Cc:        questions@freebsd.org
Subject:   Re: sonewconn: pcb 0xfffff801efdd1000: Listen queue overflow: 31 already in queue awaiting acceptance
Message-ID:  <22987F08-3543-43BE-A06A-78E76437ADD2@mac.com>
In-Reply-To: <20150316213018.GA97580@home.parts-unknown.org>
References:  <20150316213018.GA97580@home.parts-unknown.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 16, 2015, at 2:30 PM, David Benfell <benfell@parts-unknown.org> =
wrote:
> I'm seeing these messages in my nightly security log output. Googling
> around, I find I should increase kern.ipc.somaxconn. I have. Now to
> 4096. This in turn seems to mean I need to increase apc.shm_size in
> /usr/local/etc/php.ini and I have, now, to 1024M.
[ ... ]
> But 1) I have no idea how to set them properly, and 2) I don't
> understand the relationship.
>=20
> What should I be doing?

They aren't directly related.  You generally need to increase =
apc.shm_size
suitable for however many PHP processes you're running-- generally via =
mod_php
in Apache or fastcgi for nginx and the like.

The listen queue overflow means that your system is failing to process
incoming requests fast enough to keep up.  The bottleneck could be
on a resource like CPU or memory, or serialization against a database
table, or something else.  (You'll want to identify the bottleneck.)

Having a bigger listen queue can be helpful if you see transient bursts
of high activity.  However, if the load is not a brief spike, then
you've only got 90 seconds or so with typical web clients before they
decide to time out and drop the connection.

Don't try growing the listen queue longer than that, because it won't =
help--
in fact, it's counterproductive to system resources on an already-busy =
system.
(Thus notions like "surge queue tuning", "surge protection", etc on
load-balancers commonly used for large sites.)

Regards,
--=20
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?22987F08-3543-43BE-A06A-78E76437ADD2>