So this Go server is slower than a single threaded, blocking TCP server in Ruby. And the memory? Almost the same:
require "socket" s = TCPServer.new 'localhost', 1201 loop do c = s.accept if c.read(4) c << 'Pong' end c.close end
require "socket" s = TCPServer.new 'localhost', 1201 loop do c = s.accept if c.read(4) c << 'Pong' end c.close end
In short, every round is fully served, and the concurrency level is 100.
dial tcp 127.0.0.1:1201: connection refused
i changed 'localhost' to '127.0.0.1' and now I see a whole lot of dial tcp 127.0.0.1:1201: connection reset by peer
some connections were successful though.