-
Notifications
You must be signed in to change notification settings - Fork 107
/
usp.sh
executable file
·64 lines (41 loc) · 1.95 KB
/
usp.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
#!/bin/sh
# usp.sh
# gcc -DU_KEEP_ALIVES -static bench1.c -o bench_keepalive
# gcc -static bench1.c -o bench_NO_keepalive
# const char* IP = (argv[1]? argv[1] :"localhost");
# const char* URL = (argv[2]? argv[2] :"/index.html");
# int PORT = (argv[3]?atoi(argv[3]):80);
# int FROM = (argv[4]?atoi(argv[4]):0);
# int TO = (argv[5]?atoi(argv[5]):1000);
# I had to increase the local port range (because of the TIME_WAIT status of the TCP ports)
# net.ipv4.ip_local_port_range = 1024 65535
/sbin/sysctl -w net/ipv4/ip_local_port_range="1024 65535"
HOST=$1
#HOST=stefano
#HOST=giallo
mkdir -p $HOST && chmod 777 $HOST
# ab -n 1000000 -c 10 -S -d -t 1 -H 'Accept-Encoding: gzip,deflate' "http://$HOST:80/usp/benchmarking.usp?name=stefano" // NO Keep-Alives
# ab -n 1000000 -c 10 -S -d -t 1 -k -H 'Accept-Encoding: gzip,deflate' "http://$HOST:80/usp/benchmarking.usp?name=stefano" // KEEP-ALIVES
./bench_keepalive $HOST "/100.html" 80 0 1000
mv $1/test.txt $1/userver_tcp_100_keepalive.csv
sleep 60
./bench_NO_keepalive $HOST "/100.html" 80 0 1000
mv $1/test.txt $1/userver_tcp_100_NO_keepalive.csv
sleep 60
./bench_NO_keepalive $HOST "/1000.html" 80 0 1000
mv $1/test.txt $1/userver_tcp_1000_NO_keepalive.csv
sleep 60
./bench_keepalive $HOST "/1000.html" 80 0 1000
mv $1/test.txt $1/userver_tcp_1000_keepalive.csv
sleep 60
./bench_keepalive $HOST "/ws/flash-bridge/WebSocketMain.swf" 80 0 1000
mv $1/test.txt $1/userver_tcp_big_keepalive.csv
sleep 60
./bench_NO_keepalive $HOST "/ws/flash-bridge/WebSocketMain.swf" 80 0 1000
mv $1/test.txt $1/userver_tcp_big_NO_keepalive.csv
sleep 60
./bench_NO_keepalive $HOST "/usp/benchmarking.usp?name=stefano" 80 0 1000
mv $1/test.txt $1/usp_NO_keepalive.csv
sleep 60
./bench_keepalive $HOST "/usp/benchmarking.usp?name=stefano" 80 0 1000
mv $1/test.txt $1/usp_keepalive.csv