-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathsetup.sh
119 lines (95 loc) · 2.68 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/bash
# This script is intended to be run on a 64-bit Ubuntu server install or a
# 64-bit Ubuntu EC2 instance. The command I use to create that instance is:
# ec2-run-instances ami-cef405a7 -k ec2-keypair -t c1.xlarge
sudo apt-get update
sudo apt-get install -y build-essential libgmp3-dev zlib1g-dev git-core curl httperf libbsd-dev libpcre3-dev openssl libssl-dev libxml2-dev python-setuptools python-pycurl openjdk-6-jre-headless libncurses5-dev
# Haskell
## GHC
cd ~
wget http://haskell.org/ghc/dist/7.0.2/ghc-7.0.2-x86_64-unknown-linux.tar.bz2
tar jxfv ghc-7.0.2-x86_64-unknown-linux.tar.bz2
cd ghc-7.0.2
./configure
sudo 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)
cd ~
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
sudo make install
# PHP
cd ~
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 make install
sudo 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
## Tornado
cd ~
wget http://github.com/downloads/facebook/tornado/tornado-1.2.1.tar.gz --no-check-certificate
tar zxfv tornado-1.2.1.tar.gz
cd tornado-1.2.1
sudo python setup.py install
# 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
sudo make install
# 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
sudo make install
sudo ldconfig
# Erlang/OTP
cd ~
wget http://www.erlang.org/download/otp_src_R15B02.tar.gz
tar xzf otp_src_R15B02.tar.gz
cd otp_src_R15B02
./configure && make && sudo make install
# Run the benchmarks themselves
## Fetch benchmarks repo
cd ~
git clone https://github.com/yesodweb/benchmarks.git
## Build Erlang code
cd ~/benchmarks/pong/erlang
./rebar get-deps compile generate -f
## Compile Haskell code
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 +RTS -A4M -N3
./summary.sh
grep 'Request rate' -rn results/ | sed 's@results/\([^:]*\).*rate: \(.*\) req/s.*@\1 \2@' > results-summary