Browse Source

add the nginx scenario for comparison

master
Nicolas Massé 5 years ago
parent
commit
34f8330d5f
  1. 27
      jmeter/golang-http-benchmark.jmx
  2. 2
      jmeter/run.sh
  3. 15
      nginx/deploy.sh
  4. 34
      nginx/nginx.conf

27
jmeter/golang-http-benchmark.jmx

@ -55,6 +55,33 @@
<boolProp name="displaySystemProperties">false</boolProp>
</DebugSampler>
<hashTree/>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="If nginx" enabled="true">
<stringProp name="IfController.condition">${__jexl3(&quot;${scenario}&quot; == &quot;nginx&quot;,)}</stringProp>
<boolProp name="IfController.evaluateAll">false</boolProp>
<boolProp name="IfController.useExpression">true</boolProp>
</IfController>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="nginx" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">${server_hostname}</stringProp>
<stringProp name="HTTPSampler.port">80</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
</hashTree>
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="If golang-net-http" enabled="true">
<stringProp name="IfController.condition">${__jexl3(&quot;${scenario}&quot; == &quot;golang-net-http&quot;,)}</stringProp>
<boolProp name="IfController.evaluateAll">false</boolProp>

2
jmeter/run.sh

@ -6,7 +6,7 @@ set -e # Do not continue if jmeter fails
export HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m"
date="$(date +%F-%H-%M-%S)"
for scenario in golang-net-http golang-fasthttp; do
for scenario in nginx golang-net-http golang-fasthttp; do
echo
echo "================================================================================"
echo "Running scenario $scenario..."

15
nginx/deploy.sh

@ -0,0 +1,15 @@
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: $0 user@target.hostname"
exit 1
fi
set -xe
ssh $1 mkdir -p /srv/nginx/default/
echo "Hello, World!" | ssh $1 tee /srv/nginx/default/index.html
scp nginx.conf $1:/etc/nginx/nginx.conf
ssh $1 /etc/init.d/nginx restart || true
ssh $1 pgrep nginx
curl http://$1/

34
nginx/nginx.conf

@ -0,0 +1,34 @@
user nobody nogroup;
worker_processes auto;
worker_cpu_affinity auto;
error_log syslog:server=unix:/dev/log,nohostname crit;
events {
worker_connections 1024;
multi_accept on;
}
http {
# don't leak nginx version number in the "Server" HTTP Header
server_tokens off;
server_names_hash_bucket_size 64;
include mime.types;
access_log off;
sendfile on;
keepalive_timeout 65;
gzip off;
server {
listen 0.0.0.0:80 deferred;
# Main content
root /srv/nginx/default;
index index.html index.htm;
}
}
Loading…
Cancel
Save