# Ruby + FreeBSD = bandwidth killer?

**URL:** <https://www.ruby-forum.com/t/ruby-freebsd-bandwidth-killer/154184>\
**Category:** Ruby\
**Created:** [November 26, 2008, 8:33am UTC](https://www.ruby-forum.com/t/ruby-freebsd-bandwidth-killer/154184 "2008-11-26T08:33:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [November 26, 2008, 8:33am UTC](https://www.ruby-forum.com/t/ruby-freebsd-bandwidth-killer/154184/1 "2008-11-26T08:33:43Z")

</div>

This is a bizarre situation. I have a program that makes heavy use of  
Hpricot. The program uses the Daemons gem to break apart into multiple  
processes all running essentially the same program, each working on a  
different set of data.

The program runs fine on Leopard. However, when I run the same program  
on a FreeBSD box with comparable hardware, it drains the life from my  
bandwidth.

The FreeBSD machine is a bare-bones install of 6.3. I installed Ruby and  
Ruby Gems, nothing else.

Any ideas?

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [November 26, 2008, 8:40am UTC](https://www.ruby-forum.com/t/ruby-freebsd-bandwidth-killer/154184/2 "2008-11-26T08:40:07Z")

</div>

- Daniel W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) [2008-11-26 16:29:01 +0900]:

> Hpricot. The program uses the Daemons gem to break apart into multiple
> 
> The program runs fine on Leopard. However, when I run the same program  
> on a FreeBSD box with comparable hardware, it drains the life from my  
> bandwidth.

has it anything to do with Daemons? I had a similar issue when running  
a program in the background. With Daemons it was using up a 70% of my  
RAM  
for no reason. The same program runs without using much or no resources  
without  
Daemons (require ‘daemons’).

saji

–  
Saji N. Hameed

APEC Climate Center +82 51 668 7470  
National Pension Corporation Busan Building 12F  
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 removed\_email\_address@domain.invalid  
KOREA

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [November 26, 2008, 8:49am UTC](https://www.ruby-forum.com/t/ruby-freebsd-bandwidth-killer/154184/3 "2008-11-26T08:49:00Z")

</div>

Saji N. Hameed wrote:

> has it anything to do with Daemons? I had a similar issue when running  
> a program in the background.

I doubt it. As I said, I can run the same program on Leopard with no  
issues.

RAM is a non-issue. Even with 10 of these processes going, each machine  
has about 300 MB of available RAM (1 gig total).

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [November 26, 2008, 9:09am UTC](https://www.ruby-forum.com/t/ruby-freebsd-bandwidth-killer/154184/4 "2008-11-26T09:09:24Z")

</div>

Have you got any netstat data between the two boxes?

netstat with -a, b, m, s might show some interesting diffs …

---

<div class="post-metadata">

**Author:** ![dewie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dewie](https://www.ruby-forum.com/u/dewie)\
**Post date:** [November 26, 2008, 9:28am UTC](https://www.ruby-forum.com/t/ruby-freebsd-bandwidth-killer/154184/5 "2008-11-26T09:28:17Z")

</div>

Sean Mehan wrote:

> Have you got any netstat data between the two boxes?
> 
> netstat with -a, b, m, s might show some interesting diffs …

Hmm… each of those show a ton of information. Not sure what you’d want  
to look at.

Here’s a snippet of netstat -p tcp on Leopard:

Active Internet connections  
Proto Recv-Q Send-Q Local Address Foreign Address  
(state)  
tcp4 0 0 192.168.1.100.54298 iw-in-f103.googl.http  
SYN\_SENT  
tcp4 0 0 192.168.1.100.54297 eh-in-f99.google.http  
FIN\_WAIT\_1  
tcp4 0 0 192.168.1.100.54174 iw-in-f103.googl.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.54171 iw-in-f103.googl.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.54170 iy-in-f127.googl.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.54169 cf-in-f165.googl.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.54163 gx-in-f165.googl.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.54159 server.andreas-s.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.54158 server.andreas-s.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.54157 server.andreas-s.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.54154 server.andreas-s.http  
CLOSE\_WAIT  
tcp4 0 0 192.168.1.100.52363 205.188.13.40.aol  
ESTABLISHED  
tcp4 0 0 192.168.1.100.52362 caim-m04b.blue.a.aol  
ESTABLISHED  
tcp4 0 0 192.168.1.100.52361 oam-m01b.blue.ao.aol  
ESTABLISHED  
tcp4 0 0 192.168.1.100.52360 205.188.8.196.aol  
ESTABLISHED  
tcp4 0 0 192.168.1.100.52358 kc-in-f125.googl.jabbe  
ESTABLISHED  
tcp4 0 0 192.168.1.100.54144 eh-in-f99.google.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54143 iw-in-f104.googl.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54142 eh-in-f99.google.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54146 eh-in-f99.google.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54145 iw-in-f104.googl.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54149 iw-in-f104.googl.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54148 eh-in-f99.google.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54147 iw-in-f104.googl.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54151 iw-in-f104.googl.http  
TIME\_WAIT  
tcp4 0 0 192.168.1.100.54150 eh-in-f99.google.http  
TIME\_WAIT  
… goes on with many more connections to Google…

Based on this bit of Ruby:

loop { Hpricot(open(‘[http://google.com](http://google.com)’)) }

I get similar output on the FreeBSD machine.
