tags:

views:

45

answers:

2

I have a general ubuntu server, and I want to use Ruby to deal with many TCP requests, I want to know how many connections it can handle.

A: 

Ruby is merely a language. Do you mean a web server running Ruby code? Then that really depends on the environment it's on, it's configuration, etc.

Steven
I mean one Ruby script
why
Then the answer is "as many as the host environment the script is running on"
Gareth
So do you think there is performance problem if using Ruby to deal with too many tcp connections?
why
Well, I could write a script which would cause performance problems when using *one* TCP connection. Using more connections certainly means you have to think harder about your performance issues, but the issues won't be down to the number of connections you're limited to
Gareth
+2  A: 

A single Ruby process can handle as many connections as the machine/ubuntu will allow the ruby process. This is a process limitation that is managed by the linux kernel. Use ulimit to increase file descriptors and you can have more socket connections. You will also need memory to handle a large number of connections and you may need to tune tcp settings.

abdollar