<div dir="ltr">I use Charles (<a href="http://www.charlesproxy.com/">http://www.charlesproxy.com/</a>) to simulate slow connections, you can just add a latency in to the throttling settings. There's also Apple's Network Link Conditioner, used to come with XCode but not any more, think you need to download the OS X hardware tools from Apple so you may need a dev center login.<br>
</div><div class="gmail_extra"><br clear="all"><div><div>-- </div><div>David Burrows</div><div>079 1234 2125</div><div>@dburrows</div><div><br></div><div><a href="http://www.designsuperbuild.com/" target="_blank">http://www.designsuperbuild.com/</a> | @dsgnsprbld</div>
</div>
<br><br><div class="gmail_quote">On Tue, Feb 5, 2013 at 11:13 AM, Tom Stuart <span dir="ltr"><<a href="mailto:tom@codon.com" target="_blank">tom@codon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 5 Feb 2013, at 11:07, Andrew Stewart wrote:<br>
> To test that it was working, I added a `sleep 3` inside the `request.on_complete` block (lines 17-19).  I then gave it an array of 40 URLs of assets on Amazon S3 and ran it.<br>
><br>
> I was expecting this to take ~40s but it actually took 120s.  What am I doing wrong?<br>
<br>
</div>Typhoeus uses non-blocking I/O to perform simultaneous requests — it's still single-threaded, like EventMachine. If you sleep the (only) interpreter thread 40 times, you'll wait 120 seconds regardless of any I/O you're doing.<br>

<br>
If you want to test it for real, you'll need to arrange for each HTTP request to actually take 3 seconds to return. Maybe write a little Rack app that sleeps for 3 seconds before responding, run it locally in a multithreaded application server (e.g. Puma), and point your code at that instead of S3?<br>

<br>
Cheers,<br>
-Tom<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
</div></div></blockquote></div><br></div>