Started benchmark script
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent 135afb0 · Browse files · 5 files·+94 added−2 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+94 added−2 removed
- other:+94 added−2 removed
Provenance
- Commit
3851957- Tree
62365dd- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
135afb0
5 files changed+94 added−2 removed
added:benchmarks/express/simple.js+9 added
123456789
require.paths.unshift('lib')require('express')
get('/simple', function(){ return 'Hello :)'})
run()No newline at end of fileadded:benchmarks/express/simple.js.out+44 added
1+This is ApacheBench, Version 2.3 <$Revision: 655654 $>2+Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/3+Licensed to The Apache Software Foundation, http://www.apache.org/4+5+Benchmarking 127.0.0.1 (be patient)6+7+8+Server Software: 9+Server Hostname: 127.0.0.110+Server Port: 300011+12+Document Path: /13+Document Length: 9 bytes14+15+Concurrency Level: 5016+Time taken for tests: 1.475 seconds17+Complete requests: 500018+Failed requests: 019+Write errors: 020+Non-2xx responses: 500021+Total transferred: 270000 bytes22+HTML transferred: 45000 bytes23+Requests per second: 3390.39 [#/sec] (mean)24+Time per request: 14.748 [ms] (mean)25+Time per request: 0.295 [ms] (mean, across all concurrent requests)26+Transfer rate: 178.79 [Kbytes/sec] received27+28+Connection Times (ms)29+ min mean[+/-sd] median max30+Connect: 0 0 0.3 0 431+Processing: 5 14 1.7 14 2532+Waiting: 5 14 1.7 14 2533+Total: 9 15 1.6 14 2634+35+Percentage of the requests served within a certain time (ms)36+ 50% 1437+ 66% 1538+ 75% 1539+ 80% 1540+ 90% 1641+ 95% 1742+ 98% 2143+ 99% 2444+ 100% 26 (longest request)added:benchmarks/run+33 added
1+#!/usr/bin/env bash2+3+SLEEP=${SLEEP-5}4+ABFLAGS=${ABFLAGS-"-n 5000 -c 50"}5+ADDR=${ADDR-http://127.0.0.1:3000/}6+AB=${AB-ab}7+RUBY=${RUBY-ruby}8+NODE=${NODE-node}9+PHP=${PHP-php}10+11+log(){12+ echo "... $@"13+}14+15+bm(){16+ local type=$117+ local file=$218+ log benchmarking $type $file19+ case $type in20+ express)21+ $NODE benchmarks/express/$file &22+ ;;23+ esac24+ log $type $file started as process $!25+ log allowing $SLEEP seconds to startup26+ sleep $SLEEP27+ log $AB $ABFLAGS $ADDR28+ $AB $ABFLAGS -e benchmarks/$type/$file.csv $ADDR > benchmarks/$type/$file.out29+ kill -KILL $!30+}31+32+log ab $ABFLAGS $ADDR33+bm express simple.jsmodified:.gitignore+2 added-1 removed
1 .DS_Store2 *.seed3-*.log3+*.log4+*.csvmodified:Makefile+6 added-1 removed
1 2+AB = ab3+ABFLAGS = -n 3000 -c 504 NODE = node5 COFFEE = coffee6 PREFIX = /usr/local7 23 unmodified lines31 @$(NODE) examples/coffee-upload/app.js32 33 compile-coffee:34 @$(COFFEE) examples/coffee-upload/app.coffee33- 35+36+benchmark: benchmarks/run37+ @./benchmarks/run38+39 .PHONY: install test app