7.3 + kqueue + apache/php + DNS lookup problem

Doug Barton dougb at FreeBSD.org
Fri Sep 30 23:31:19 UTC 2011


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/



More information about the freebsd-stable mailing list