File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,9 +57,8 @@ def prereqs
5757ENV [ "RUBY_HEAP_MIN_SLOTS" ] = "800000"
5858ENV [ "RUBY_FREE_MIN" ] = "600000"
5959
60-
6160def port_available? port
62- server = TCPServer . open port
61+ server = TCPServer . open ( "0.0.0.0" , port )
6362 server . close
6463 true
6564rescue Errno ::EADDRINUSE
@@ -86,9 +85,9 @@ def port_available? port
8685
8786def bench ( path )
8887 puts "Running apache bench warmup"
89- `ab -n 100 http://localhost :#{ @port } #{ path } `
88+ `ab -n 100 http://127.0.0.1 :#{ @port } #{ path } `
9089 puts "Benchmarking #{ path } "
91- `ab -n 100 -e tmp/ab.csv http://localhost :#{ @port } #{ path } `
90+ `ab -n 100 -e tmp/ab.csv http://127.0.0.1 :#{ @port } #{ path } `
9291
9392 percentiles = Hash [ *[ 50 , 75 , 90 , 99 ] . zip ( [ ] ) . flatten ]
9493 CSV . foreach ( "tmp/ab.csv" ) do |percent , time |
@@ -105,6 +104,8 @@ def bench(path)
105104 sleep 1
106105 end
107106
107+ puts "Starting benchmark..."
108+
108109 home_page = bench ( "/" )
109110 topic_page = bench ( "/t/oh-how-i-wish-i-could-shut-up-like-a-tunnel-for-so/69" )
110111
You can’t perform that action at this time.
0 commit comments