# Limiting rate on downloading a file http?

**URL:** <https://www.ruby-forum.com/t/limiting-rate-on-downloading-a-file-http/129812>\
**Category:** Ruby\
**Created:** [February 21, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/limiting-rate-on-downloading-a-file-http/129812 "2008-02-21T19:12:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyleh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Post date:** [February 21, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/limiting-rate-on-downloading-a-file-http/129812/1 "2008-02-21T19:12:36Z")

</div>

Hi all,

I’m looking for a solution for downloading a file from http and limiting  
the download rate. I do not want to use `wget`. I hear you can atleast  
get a ball-park rate-limit out there by using open-uri and sleep. Any  
other suggestion, or gems/etc. that can help me?

Thanks.

---

<div class="post-metadata">

**Author:** ![kyleh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Post date:** [March 5, 2008, 8:32pm UTC](https://www.ruby-forum.com/t/limiting-rate-on-downloading-a-file-http/129812/2 "2008-03-05T20:32:40Z")

</div>

On [Fri, 22.02.2008 03:12], Kyle H. wrote:

> Hi all,
> 
> I’m looking for a solution for downloading a file from http and limiting  
> the download rate. I do not want to use `wget`. I hear you can atleast  
> get a ball-park rate-limit out there by using open-uri and sleep. Any  
> other suggestion, or gems/etc. that can help me?
> 
> ## Thanks.
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Well, if you are using Linux, you can have a look at the program  
trickle,  
an user-space bandwidth shaper/limiter.

But that would be more like… “trickle $settings ruby file.rb”, so not  
implemented inside your script,  
and as said before, linux only. (Dont know about Mac though)
