<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Benchmarking PHP HTTP Clients</title>
	<atom:link href="http://matthewturland.com/2008/11/23/benchmarking-php-http-clients/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewturland.com/2008/11/23/benchmarking-php-http-clients/</link>
	<description></description>
	<lastBuildDate>Mon, 08 Mar 2010 16:47:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matthew Turland</title>
		<link>http://matthewturland.com/2008/11/23/benchmarking-php-http-clients/comment-page-1/#comment-234</link>
		<dc:creator>Matthew Turland</dc:creator>
		<pubDate>Tue, 25 Nov 2008 03:03:09 +0000</pubDate>
		<guid isPermaLink="false">tag:ishouldbecoding.com,2008:benchmarking-php-http-clients/1227412005#comment-234</guid>
		<description>As far as I can tell, Ubuntu does not have a DNS cache running by default. nscd is available as a package for it and I tried installing it, but found this comment in the configuration file:

# hosts caching is broken with gethostby* calls, hence is now disabled
# per default.  See /usr/share/doc/nscd/NEWS.Debian.

So I uninstalled that and followed this tutorial to install, configure, and test dnsmasq instead:

http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/

I also amended a few oversights in my original example. The curl options array should include CURLOPT_FOLLOWLOCATION and the pecl_http options array should include &#039;redirect.&#039; Using a GET request that results in a redirect as the test subject, I got the following results.

Before installing dnsmasq:
pecl_http - 12.75%
streams - 25.27%
curl - 12.92%
pear - 32.82%
zend - 24.50%

After installing dnsmasq:
pecl_http - 19.58%
streams - 21.40%
curl - 17.30%
pear - 28.20%
zend - 21.10%

So, a local OS-level DNS cache does bring the performance of these clients significantly closer to equal footing. Lars and Pierre, thanks for helping to clear this up!</description>
		<content:encoded><![CDATA[<p>As far as I can tell, Ubuntu does not have a DNS cache running by default. nscd is available as a package for it and I tried installing it, but found this comment in the configuration file:</p>
<p># hosts caching is broken with gethostby* calls, hence is now disabled<br />
# per default.  See /usr/share/doc/nscd/NEWS.Debian.</p>
<p>So I uninstalled that and followed this tutorial to install, configure, and test dnsmasq instead:</p>
<p><a href="http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/" rel="nofollow">http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/</a></p>
<p>I also amended a few oversights in my original example. The curl options array should include CURLOPT_FOLLOWLOCATION and the pecl_http options array should include &#8216;redirect.&#8217; Using a GET request that results in a redirect as the test subject, I got the following results.</p>
<p>Before installing dnsmasq:<br />
pecl_http &#8211; 12.75%<br />
streams &#8211; 25.27%<br />
curl &#8211; 12.92%<br />
pear &#8211; 32.82%<br />
zend &#8211; 24.50%</p>
<p>After installing dnsmasq:<br />
pecl_http &#8211; 19.58%<br />
streams &#8211; 21.40%<br />
curl &#8211; 17.30%<br />
pear &#8211; 28.20%<br />
zend &#8211; 21.10%</p>
<p>So, a local OS-level DNS cache does bring the performance of these clients significantly closer to equal footing. Lars and Pierre, thanks for helping to clear this up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Strojny</title>
		<link>http://matthewturland.com/2008/11/23/benchmarking-php-http-clients/comment-page-1/#comment-233</link>
		<dc:creator>Lars Strojny</dc:creator>
		<pubDate>Mon, 24 Nov 2008 14:04:51 +0000</pubDate>
		<guid isPermaLink="false">tag:ishouldbecoding.com,2008:benchmarking-php-http-clients/1227412005#comment-233</guid>
		<description>Was nscd (name service cache daemon) running? Don&#039;t know what&#039;s the default on Ubuntu.</description>
		<content:encoded><![CDATA[<p>Was nscd (name service cache daemon) running? Don&#8217;t know what&#8217;s the default on Ubuntu.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre</title>
		<link>http://matthewturland.com/2008/11/23/benchmarking-php-http-clients/comment-page-1/#comment-232</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Sun, 23 Nov 2008 19:13:26 +0000</pubDate>
		<guid isPermaLink="false">tag:ishouldbecoding.com,2008:benchmarking-php-http-clients/1227412005#comment-232</guid>
		<description>CURL uses its own DNS cache system, independently of OS (if it implements any). The PECL HTTP uses CURL and its DNS cache (via the option dns_cache_timeout).

I do not think php has a DNS cache (but only did a quick grep, I&#039;d to check again more deeply.</description>
		<content:encoded><![CDATA[<p>CURL uses its own DNS cache system, independently of OS (if it implements any). The PECL HTTP uses CURL and its DNS cache (via the option dns_cache_timeout).</p>
<p>I do not think php has a DNS cache (but only did a quick grep, I&#8217;d to check again more deeply.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
