From: Robert Klemme Date: 2006-09-01T17:05:35+09:00 Subject: Re: Testing Threads with connections On 01.09.2006 02:16, Denis Vieira wrote: > Hello there, > > I've been trying to make a stress test generator in ruby for a New IO > echo server initially. > > Mainly, the idea is try to generate as many connections as possible to > the echo server, and from time to time, send a string to the server and > receive it back. > > I don't really have much experience in threads programming, and that's > the main reason to try it out. > > For this script, I thought to open threads, and in each thread, do a > loop and open connections for each thread. I tried to use 100 > threads and in each thread, open 100 connections. It runs fine, no > errors reported to me at all, but the echo server shows only ~1200 > connections. > > I've set up the OS settings with ulimit already (open files). > > What do you guys think ? Any suggestions? Insert this at the top of your script to see whether there are exceptions during connection creation: Thread.abort_on_exception = true Alternatively, wrap each thread's main processing body in a begin rescue end to print out exceptions. (Thinking about it I'd prefer the second approach anyway as it makes up for more robust software.) HTH Kind regards robert