Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby TCP: Any benchmarks?

I have a remote server that needs to be able to accept multiple simultaneous connections from clients on a specific port. I need the connections to be fast and reliable.

I am planning to use TCPServer on the remote side and TCPSocket on the client side. There'd likely be 200+ connections to the server.

Do we have any known benchmarks in Ruby for a system like this? Also, do I need to worry about the underlying data multiplexing at socket level or Ruby/OS libraries take care of the same?

Finally, will you folks be able to recommend me any specific links/books that talk about designing systems like this? I googled but books about networking in Ruby seem to be an oddity.

like image 635
Fanatic23 Avatar asked Apr 08 '26 04:04

Fanatic23


1 Answers

A multi-client TCP server generally creates a separate thread for each client. Therefore, it can handle as many connections as the machine/OS will allow. This limitation is managed by the kernel. So, as far as benchmarks go, it really depends on the performance of your machine.

Here is a link to some examples/tutorials for Ruby Socket Programming:

  • http://www.tutorialspoint.com/ruby/ruby_socket_programming.htm
like image 114
jtomschroeder Avatar answered Apr 10 '26 18:04

jtomschroeder