From owner-freebsd-net@FreeBSD.ORG Tue Dec 6 12:52:38 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E54D16A422 for ; Tue, 6 Dec 2005 12:52:38 +0000 (GMT) (envelope-from is@rambler-co.ru) Received: from yam.park.rambler.ru (yam.park.rambler.ru [81.19.64.116]) by mx1.FreeBSD.org (Postfix) with ESMTP id B663443D7E for ; Tue, 6 Dec 2005 12:52:33 +0000 (GMT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by yam.park.rambler.ru (8.13.3/8.13.3) with ESMTP id jB6CqV9C044170 for ; Tue, 6 Dec 2005 15:52:31 +0300 (MSK) (envelope-from is@rambler-co.ru) Date: Tue, 6 Dec 2005 15:52:31 +0300 (MSK) From: Igor Sysoev X-X-Sender: is@is.park.rambler.ru To: freebsd-net@freebsd.org In-Reply-To: <20051201120928.N32133@is.park.rambler.ru> Message-ID: <20051206154450.L67178@is.park.rambler.ru> References: <20050901140051.G11484@is.park.rambler.ru> <20050901182115.F11484@is.park.rambler.ru> <20051201120928.N32133@is.park.rambler.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: strange timeout error returned by kevent() in 6.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2005 12:52:38 -0000 On Thu, 1 Dec 2005, Igor Sysoev wrote: > On Thu, 1 Sep 2005, Igor Sysoev wrote: > >> On Thu, 1 Sep 2005, Igor Sysoev wrote: >> >>> I found strange timeout errors returned by kevent() in 6.0 using >>> my http server named nginx. The nginx's run on three machines: >>> two 4.10-RELEASE and one 6.0-BETA3. All machines serve the same >>> content (simple cluster) and each handles about 200 requests/second. >>> >>> On 6.0 sometimes (2 or 3 times per hour) in the daytime kevent() >>> returns EV_EOF in flags and ETIMEDOUT in fflags, nevertheless: >>> >>> 1) nginx does not set any kernel timeout for sockets; >>> 2) the total request time for such failed requests is small, 30 and so >>> seconds. >> >> I have changed code to ignore the ETIMEDOUT error returned by kevent() >> and found that subsequent sendfile() returned the ENOTCONN. >> >> By the way, why sendfile() may return ENOTCONN ? >> I saw this error code on 4.x too. > > Recently I've found that kevent() in FreeBSD 5.4 may return wrong > the ETIMEDOUT too. > > Also I've found that recv() on FreeBSD 6.0 may return wrong ETIMEDOUT > error for socket that has no any kernel timeout. It seems this > ETIMEDOUT error masks another error. It's seems that this ETIMEDOUT is caused by a retransmit failure, when data were retransmited 12 times with backoff timeout. The whole timeout is small, 30-50 seconds, because the initial RTO is very small: 5-10 ms. Igor Sysoev http://sysoev.ru/en/