From owner-freebsd-net@FreeBSD.ORG Thu May 12 10:56:51 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47F8E106566B for ; Thu, 12 May 2011 10:56:51 +0000 (UTC) (envelope-from dudu@dudu.ro) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 0C09A8FC14 for ; Thu, 12 May 2011 10:56:50 +0000 (UTC) Received: by qyk35 with SMTP id 35so3278788qyk.13 for ; Thu, 12 May 2011 03:56:50 -0700 (PDT) Received: by 10.229.87.143 with SMTP id w15mr15659qcl.170.1305195971147; Thu, 12 May 2011 03:26:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.31.73 with HTTP; Thu, 12 May 2011 03:25:31 -0700 (PDT) In-Reply-To: <17710363528.20110512130123@gameservice.ru> References: <17710363528.20110512130123@gameservice.ru> From: Vlad Galu Date: Thu, 12 May 2011 12:25:31 +0200 Message-ID: To: Michael Content-Type: text/plain; charset=KOI8-R X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org Subject: Re: Random TCP 3 second delay 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: Thu, 12 May 2011 10:56:51 -0000 2011/5/12 Michael > Hello. > > I'm running nginx in load balancing mode for java application with > around 400 requests/second. For every request, nginx is doing a > HTTP/1.0 connection without keep alive to jetty. Several > times per minute this connection takes 3 seconds complete. I don't see > 2 or 1 seconds response from upstream, only 3 seconds. Listen backlog is > not > overflowed. > > I searched for this delay in google, and found similar problem in Linux: > http://kerneltrap.org/mailarchive/linux-net/2008/3/26/1264734/thread > http://kerneltrap.org/mailarchive/linux-net/2008/2/4/713224/thread > > And Windows: > > http://stackoverflow.com/questions/1875151/delay-in-multiple-tcp-connections-from-java-to-the-same-machine/1927486#1927486 > > Can you advice what should i tune in FreeBSD to fix this problem? > Hello Michael, net.inet.tcp.finwait2_timeout and net.inet.tcp.fast_finwait2_recycle are your friends. -- Good, fast & cheap. Pick any two.