From owner-freebsd-current@freebsd.org Fri Oct 12 19:59:37 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D073210C8E54 for ; Fri, 12 Oct 2018 19:59:37 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from ihor-3.amdmi3.ru (ihor-3.amdmi3.ru [185.117.152.228]) by mx1.freebsd.org (Postfix) with ESMTP id 56EFB73998 for ; Fri, 12 Oct 2018 19:59:37 +0000 (UTC) (envelope-from amdmi3@amdmi3.ru) Received: from amdmi3.ru (localhost [127.0.0.1]) by ihor-3.amdmi3.ru (Postfix) with SMTP id 825381AF137; Fri, 12 Oct 2018 22:59:35 +0300 (MSK) Received: by amdmi3.ru (nbSMTP-1.00) for uid 1000 amdmi3@amdmi3.ru; Fri, 12 Oct 2018 22:59:35 +0300 (MSK) Date: Fri, 12 Oct 2018 22:51:01 +0300 From: Dmitry Marakasov To: nginx@nginx.org, freebsd-current@FreeBSD.org Subject: nginx introduces extra delay when talking to slow backend (probably FreeBSD kevent specific) Message-ID: <20181012195101.GG79805@hades.panopticon> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2018 19:59:38 -0000 Hi! I've noticed strange behavior of nginx with slow uwsgi backend (turned out to not be uwsgi specific, and acually reproduces with any backend) on FreeBSD 11.2 If backend replies in less than a second, nginx doesn't introduce any additional latency and replies in the same time. However if backend replies no more than around 1.2 seconds, nginx introduces an extra delay and replies in around 2.2 seconds. I've gathered some details here, including the graph of nginx reply time vs. backend reply time: https://github.com/AMDmi3/nginx-bug-demo It reproduces on FreeBSD 11.2 and around year old -CURRENT, but not the recent -CURRENT, so I suspect this may be FreeBSD specific (probably kevent-related) and already fixed. Still, I'm posting to both related nginx and FreeBSD lists for this problem to be known. -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D amdmi3@amdmi3.ru ..: https://github.com/AMDmi3