FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node/benchmark/http_simple_bench.sh at master · appleskiller/node · GitHub
appleskiller
node
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node
/
benchmark
/
http_simple_bench.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
74 lines (55 loc) · 1.44 KB
Breadcrumbs
node
/
benchmark
/
http_simple_bench.sh
Copy path
File metadata and controls
executable file
·
74 lines (55 loc) · 1.44 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!
/bin/bash
SERVER=127.0.0.1
PORT=
${PORT
:=
8000}
#
You may want to configure your TCP settings to make many ports available
#
to node and ab. On macintosh use:
#
sudo sysctl -w net.inet.ip.portrange.first=32768
#
sudo sysctl -w net.inet.tcp.msl=1000
if
[
!
-d
benchmark/ ]
;
then
echo
"
Run this script from the node root directory
"
exit
1
fi
if
[
$SERVER
==
"
127.0.0.1
"
]
;
then
./node benchmark/http_simple.js
&
node_pid=
$!
sleep 1
fi
date=
`
date
"
+%Y%m%d%H%M%S
"
`
ab_hello_world
() {
local
type=
"
$1
"
local
ressize=
"
$2
"
if
[
$type
==
"
string
"
]
;
then
local
uri=
"
bytes/
$ressize
"
else
local
uri=
"
buffer/
$ressize
"
fi
name=
"
ab-hello-world-
$type
-
$ressize
"
dir=
"
.benchmark_reports/
$name
/
$rev
/
"
if
[
!
-d
$dir
]
;
then
mkdir -p
$dir
fi
summary_fn=
"
$dir
/
$date
.summary
"
data_fn=
"
$dir
/
$date
.data
"
echo
"
Bench
$name
starts in 3 seconds...
"
#
let shit calm down
sleep 3
#
hammer that as hard as it can for 10 seconds.
ab -g
$data_fn
-c 100 -t 10 http://
$SERVER
:
$PORT
/
$uri
>
$summary_fn
#
add our data about the server
echo
>>
$summary_fn
echo
>>
$summary_fn
echo
"
webserver-rev:
$rev
"
>>
$summary_fn
echo
"
webserver-uname:
$uname
"
>>
$summary_fn
grep Req
$summary_fn
echo
"
Summary:
$summary_fn
"
echo
}
#
1k
ab_hello_world
'
string
'
'
1024
'
ab_hello_world
'
buffer
'
'
1024
'
#
100k
ab_hello_world
'
string
'
'
102400
'
ab_hello_world
'
buffer
'
'
102400
'
if
[
!
-z
$node_pid
]
;
then
kill
-9
$node_pid
fi
Back
|
FazBrowse Home
|
New Git URL