From owner-freebsd-stable@FreeBSD.ORG Sun Oct 2 13:31:04 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2504106564A for ; Sun, 2 Oct 2011 13:31:03 +0000 (UTC) (envelope-from michiel@boland.org) Received: from smtp-vbr14.xs4all.nl (smtp-vbr14.xs4all.nl [194.109.24.34]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8D08FC08 for ; Sun, 2 Oct 2011 13:31:03 +0000 (UTC) Received: from charlemagne.boland.org (59-36-215.ftth.xms.internl.net [82.215.36.59]) (authenticated bits=0) by smtp-vbr14.xs4all.nl (8.13.8/8.13.8) with ESMTP id p92DH3kM010329 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sun, 2 Oct 2011 15:17:03 +0200 (CEST) (envelope-from michiel@boland.org) Message-ID: <4E88644F.4040001@boland.org> Date: Sun, 02 Oct 2011 15:17:03 +0200 From: Michiel Boland User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.23) Gecko/20110930 Thunderbird/3.1.15 MIME-Version: 1.0 To: freebsd-stable@freebsd.org References: <4E865146.8090108@FreeBSD.org> <20111001003735.GA28346@icarus.home.lan> <4E866A70.8060203@FreeBSD.org> <4E883890.4020704@infracaninophile.co.uk> In-Reply-To: <4E883890.4020704@infracaninophile.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner Subject: Re: 7.3 + kqueue + apache/php + DNS lookup problem X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2011 13:31:04 -0000 On 10/02/2011 12:10, Matthew Seaman wrote: > On 01/10/2011 02:18, Doug Barton wrote: >>> Does this happen when httpd tries to do DNS resolution for, say, an >>>> incoming connection to the web server (e.g. trying to resolve the >>>> incoming IP address of the client to an FQDN), or is it happening within >>>> some PHP code (assuming PHP is installed/used as an Apache module) >>>> that's trying to do DNS resolution of some kind? > >> It's a php module doing a lookup for the hostname of the back-end mysql >> server. > > Hmmm... Is this a function of DNS traffic being via UDP? Presumably > you're not seeing the same sort of delays when eg. apache connects to > mysql via TCP. > > Hard to think of another UDP protocol you could use to test -- SNMP > perhaps? Or somehow forcing the DNS traffic to go via TCP? Tricky to > make that happen when the resolver is on localhost. Of course, since > DNS will only fall back to TCP after trying UDP, that's going to be even > slower overall than your current situation, but the point here is to > examine the truss output for timing details specifically around where > the TCP query is issued. > > Cheers, > > Matthew > What is the exact query issued and what was the response? I see recvfrom returned 30 bytes in Doug's original mail which seems awfully short for a meaningful DNS response. Cheers Michiel