Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Including setup script, running more stuff by default

  • Loading branch information...
commit fdf9f5d650662b58c775b9196e7c7b1e0a883c69 1 parent fa383c1
@snoyberg snoyberg authored
View
7 pong/happstack.sh
@@ -1,7 +1,8 @@
#!/bin/bash -x
+DIR="$( cd "$( dirname "$0" )" && pwd )"
+d=$(readlink -f $DIR)
+source lib.sh
./dist/build/happstack/happstack $* &
-nx=$!
-httperf --hog --server=localhost --port=8000 --uri=/ --rate=1000 --num-conns=200 --num-calls=100 --burst-length=20 > results/happstack
-kill $nx
+benchmark
View
3  pong/lib.sh
@@ -1,6 +1,7 @@
benchmark(){
- sleep 1
+ sleep 5
nx=$!
httperf --hog --server=localhost --port=3000 --uri=/ --rate=1000 --num-conns=200 --num-calls=100 --burst-length=20 > results/`basename $0 .sh`
kill $nx
+ sleep 2
}
View
2  pong/php.nginx.conf
@@ -22,7 +22,7 @@ http {
fastcgi_pass backend;
fastcgi_index pong.php;
fastcgi_param SCRIPT_FILENAME /home/ubuntu/benchmarks/pong$fastcgi_script_name;
- include /etc/nginx/fastcgi_params;
+ include /usr/local/nginx/conf/fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
View
2  pong/php.sh
@@ -3,7 +3,7 @@ DIR="$( cd "$( dirname "$0" )" && pwd )"
d=$(readlink -f $DIR)
source lib.sh
-php-fpm -n
+php-fpm -n -y php-fpm.conf &
sudo /usr/local/nginx/sbin/nginx -c $d/php.nginx.conf &
View
4 pong/pong.php
@@ -1,3 +1 @@
-<?
-echo "PONG";
-?>
+PONG
View
1  pong/runall.sh
@@ -2,6 +2,7 @@ mkdir -p results
./snap.sh $*
./warp.sh $*
+./happstack.sh $*
./php.sh
./tornado.sh
./node.sh
View
12 pong/winstone.sh
@@ -1,12 +1,8 @@
#!/bin/bash -x
-
-d=$(readlink -f $(dirname $0))
+DIR="$( cd "$( dirname "$0" )" && pwd )"
+d=$(readlink -f $DIR)
+source lib.sh
java -jar winstone-0.9.10.jar --warfile pong.war --httpPort=3000 &
-ja=$!
-
-sleep 1
-
-httperf --hog --server=localhost --port=3000 --uri=/ --rate=1000 --num-conns=200 --num-calls=100 --burst-length=20 > results/winstone
-kill $ja
+benchmark
View
96 setup.sh
@@ -0,0 +1,96 @@
+apt-get install -y build-essential libgmp3-dev zlib1g-dev git-core curl httperf libbsd-dev
+
+# Haskell
+
+## GHC
+cd ~
+wget http://haskell.org/ghc/dist/7.0.2/ghc-7.0.2-i386-unknown-linux.tar.bz2
+tar jxfv ghc-7.0.2-i386-unknown-linux.tar.bz2
+cd ghc-7.0.2
+./configure
+make install
+
+## cabal
+cd ~
+wget http://hackage.haskell.org/packages/archive/cabal-install/0.10.2/cabal-install-0.10.2.tar.gz
+tar zxfv cabal-install-0.10.2.tar.gz
+cd cabal-install-0.10.2
+sh bootstrap.sh
+
+# nginx (for PHP)
+sudo apt-get install -y libprce3-dev libssl-dev
+wget http://sysoev.ru/nginx/nginx-0.8.54.tar.gz
+tar zxfv nginx-0.8.54.tar.gz
+cd nginx-0.8.54
+./configure
+make
+make install
+
+# PHP
+apt-get install -y libxml2-dev
+wget http://www.php.net/get/php-5.3.5.tar.bz2/from/de.php.net/mirror
+mv mirror php-5.3.5.tar.bz2
+tar jxfv php-5.3.5.tar.bz2
+cd php-5.3.5
+./configure --enable-fpm
+make all
+sudo groupadd nobody
+
+# Ruby
+
+## RVM
+bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
+echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
+source ~/.rvm/scripts/rvm
+rvm install 1.9.2
+rvm use 1.9.2
+
+## Goliath
+gem install goliath
+
+# Python
+apt-get install -y python-setuptools python-pycurl
+
+## Tornado
+cd ~
+wget --no-check-certficate http://github.com/downloads/facebook/tornado/tornado-1.2.1.tar.gz
+tar zxfv tornado-1.2.1.tar.gz
+
+# node.js
+cd ~
+wget http://nodejs.org/dist/node-v0.4.2.tar.gz
+tar zxfv node-v0.4.2.tar.gz
+cd node-v0.4.2
+./configure --without-ssl
+make
+make install
+
+# Java
+apt-get install -y openjdk-6-jre-headless
+
+# libev for Snap
+cd ~
+wget http://dist.schmorp.de/libev/libev-4.04.tar.gz
+tar zxfv libev-4.04.tar.gz
+cd libev-4.04
+./configure
+make
+make install
+ldconfig
+
+# Run the benchmarks themselves
+
+## Compile Haskell code
+cd ~
+git clone https://github.com/snoyberg/benchmarks.git
+cd benchmarks/pong
+~/.cabal/bin/cabal update
+~/.cabal/bin/cabal install snap-server -flibev
+~/.cabal/bin/cabal install
+
+## Link in tornado
+ln -s ~/tornado-1.2.1/tornado
+
+## Run all benchmarks
+./runall.sh
+grep 'Request rate' -rn results/ | sed 's@results/\([^:]*\).*rate: \(.*\) req/s.*@\1 \2@' > results-summary
Please sign in to comment.
Something went wrong with that request. Please try again.