[LRUG] Downloading images quickly
David Burrows
david at designsuperbuild.com
Tue Feb 5 03:31:14 PST 2013
I use Charles (http://www.charlesproxy.com/) 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.
--
David Burrows
079 1234 2125
@dburrows
http://www.designsuperbuild.com/ | @dsgnsprbld
On Tue, Feb 5, 2013 at 11:13 AM, Tom Stuart <tom at codon.com> wrote:
> On 5 Feb 2013, at 11:07, Andrew Stewart wrote:
> > 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.
> >
> > I was expecting this to take ~40s but it actually took 120s. What am I
> doing wrong?
>
> 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.
>
> 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?
>
> Cheers,
> -Tom
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20130205/0caff80d/attachment-0003.html>
More information about the Chat
mailing list