Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Sep 2011 16:31:18 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        freebsd-stable@FreeBSD.org
Subject:   7.3 + kqueue + apache/php + DNS lookup problem
Message-ID:  <4E865146.8090108@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Howdy,

So, this is a bit of an odd one .... I've got a web server running
apache 2.2.17 and php 5.3.5. The host itself is running 7.3-RELEASE,
i386, and is not busy. I can do DNS queries on the command line all day
long and they are very snappy. Using nslookup, dig, whatever.

The weirdness comes in when the httpd process needs to do a DNS lookup.
With a local cache I'm getting the following:

97625 httpd    0.031139 CALL  connect(0x55,0x284fd590,0x10)
97625 httpd    0.031142 STRU  struct sockaddr { AF_INET, 127.0.0.1:53 }
97625 httpd    0.031150 RET   connect 0
97625 httpd    0.031153 CALL  sendto(0x55,0x2a7d1000,0x1e,0,0,0)
97625 httpd    0.031169 GIO   fd 85 wrote 30 bytes
97625 httpd    0.031173 RET   sendto 30/0x1e
97625 httpd    0.031179 CALL  clock_gettime(0,0xbfbfb58c)
97625 httpd    0.031184 RET   clock_gettime 0
97625 httpd    0.031188 CALL
kevent(0x54,0xbfbfb678,0x1,0xbfbfb678,0x1,0xbfbfb68c)
97625 httpd    3.064266 GIO   fd 84 wrote 20 bytes

.... note the 3 second delay here.

97625 httpd    3.064277 GIO   fd 84 read 20 bytes
97625 httpd    3.064281 RET   kevent 1
97625 httpd    3.064287 CALL
recvfrom(0x55,0x2a6c4000,0x10000,0,0xbfbfb5f8,0xbfbfb694)
97625 httpd    3.064293 GIO   fd 85 read 30 bytes
97625 httpd    3.064296 STRU  struct sockaddr { AF_INET, 127.0.0.1:53 }
97625 httpd    3.064299 RET   recvfrom 30/0x1e
97625 httpd    3.064308 CALL  close(0x55)

I'm open to suggestions on where to look to improve this situation.


Thanks,

Doug

-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E865146.8090108>