-
-
Save erikh/4f36f8543ad702861096 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
threads = [] | |
(0..ARGV[0].to_i).each do |i| | |
if i % 500 == 0 | |
puts "#{i} threads spawned" | |
end | |
threads.push( | |
Thread.new do | |
t = TCPSocket.new("test", 11211) | |
$/ = "\r\n" | |
t.puts "stats" | |
while t.readline != "END\r\n" | |
1 | |
end | |
sleep | |
end | |
) | |
end | |
threads.map(&:join) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment