Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 66784c7049
Fetching contributors…

Cannot retrieve contributors at this time

86 lines (79 sloc) 3.12 KB
<title>Boomerang Howto #8: Measure a user's DNS latency</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../boomerang-docs.css">
<span style="float:right;"><a href="../">All Docs</a> | <a href="index.html">Index</a></span>
<h1>Boomerang Howto #8: Measure a user's DNS latency</h1>
See <a href="../use-cases.html#uc-7">use case #7</a> for a description of this requirement.
<strong>Note:</strong> The DNS plugin hasn't been tested. Your help in testing it is appreciated.
Measuring DNS requires some server-side set up. The entire set up was
<a href="">documented in detail</a>
by Yahoo! engineer Carlos Bueno, so go read his post for everything you'll need to set
this up. In brief, the points he covers are:
<li>Set up a wildcard hostname, perferably one that does not share cookies with your main site.
Give it a low TTL, say, 60 seconds, so you don't pollute downstream caches.</li>
<li>Set up a webserver for the wildcard hostname that serves the images named <code>A.gif</code>
and <code>B.gif</code> (from the <a href="../../images/">images/</a> subdirectory) as fast as possible.
Make sure that KeepAlive, Nagle, and any caching headers are turned off.</li>
<li>Include <code>dns.js</code> along with <code>boomerang.js</code> (you can just concatenate the two
<li>Tell the DNS plugin where to get its images from</li>
Steps 1 and 2 are complicated, and if you don't have full control over your DNS server (eg: you use
Dreamhost), then it may be impossible for you to do this. If you can go forward, read on.
To configure the plugin, you only need to tell it where to get its images from. Unlike the bandwidth
plugin though, this URL needs a wildcard:
&lt;script src="boomerang.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="dns.js" type="text/javascript"&gt;&lt;/script&gt; &lt;!-- concatenate with boomerang.js for better performance --&gt;
&lt;script type="text/javascript"&gt;
user_ip: "&lt;user's ip address&gt;",
beacon_url: "",
<em>DNS: { </em>
<em> base_url: "http://*" </em>
<em>} </em>
If you've set things up correctly, this should measure your DNS latency within a margin of error.
We could run the test multiple times to find out what this error is, but for now we'll just do
it once.
<p class="perma-link">
The latest code and docs is available on <a href=""></a>
<p id="results">
<script src="../../boomerang.js" type="text/javascript"></script>
<script src="howtos.js" type="text/javascript"></script>
<script type="text/javascript">
user_ip: '',
BW: {
base_url: '../../images/',
cookie: 'HOWTO-BA'
RT: {
cookie: 'HOWTO-RT'
Jump to Line
Something went wrong with that request. Please try again.