Forum: Ruby Ruby + FreeBSD = bandwidth killer?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
42292bf8a0acbc98862d9306b501275d?d=identicon&s=25 Daniel Waite (rabbitcreative)
on 2008-11-26 08:33
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?
621080472679266b8e9b81aff4800398?d=identicon&s=25 Saji N. Hameed (Guest)
on 2008-11-26 08:40
(Received via mailing list)
* Daniel Waite <rabbitblue@gmail.com> [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      saji@apcc21.net
KOREA
42292bf8a0acbc98862d9306b501275d?d=identicon&s=25 Daniel Waite (rabbitcreative)
on 2008-11-26 08:49
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).
15c44591e6e5d161ce1c07012c62ead3?d=identicon&s=25 Sean Mehan (Guest)
on 2008-11-26 09:09
(Received via mailing list)
Have you got any netstat data between the two boxes?

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


<quote who="Daniel Waite">
42292bf8a0acbc98862d9306b501275d?d=identicon&s=25 Daniel Waite (rabbitcreative)
on 2008-11-26 09:28
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')) }

I get similar output on the FreeBSD machine.
This topic is locked and can not be replied to.