Rubyists,

I'm trying to setup a performance/load test to bombard a server with
a ton of requests.  The idea is to generate as many parallel requests
as possible to really stress the server. However my code already bombs
out at around 300 threads with:

naft_s.rb:140: [BUG] rb_sys_fail() - errno == 0
ruby 1.7.3 (2002-11-17) [i386-mswin32]

I also get "Bad file descriptor" errors at times.

Does anyone have any other approaches for this kind of test? Is ruby
not up to this sort of task? Would fork be a better approach?
How do I raise this limit? Any tips are welcome.

The stripped code making 500 parallel requests; each in turn doing 10
sequential requests.

#!/usr/bin/ruby -w

require 'socket'
require 'thread'

threads = []

(1..500).each do |c|
  threads << Thread.new(c) do |client|
    (1..10).each do |request|
      begin
        TCPSocket::open('localhost', 80) { |s|
          # perform some socket reading writing here
          # and print some output
        }
      rescue Exception => e
        $stderr.puts e
      end
    end
  end
end

threads.each { |t|
  t.join
}

Emiel
-- 
E F van de Laar
+31648183479
www.il.fontys.nl/~emiel