[LRUG] Downloading images quickly

JB Steadman jb at pivotallabs.com
Tue Feb 5 03:45:34 PST 2013


+1 for Charles. Especially useful for mobile development when you want to
simulate slower connections.


On Tue, Feb 5, 2013 at 11:31 AM, David Burrows
<david at designsuperbuild.com>wrote:

> 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
>>
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>


-- 
JB Steadman
Pivotal Labs - London
mobile: +44 (0) 7450 418 409
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20130205/bc84c446/attachment-0003.html>


More information about the Chat mailing list