✅ Add benchmark
All checks were successful
release-nightly / build-docker (push) Successful in 58s
All checks were successful
release-nightly / build-docker (push) Successful in 58s
This commit is contained in:
79
test/benchmark/README.md
Normal file
79
test/benchmark/README.md
Normal file
@ -0,0 +1,79 @@
|
||||
# Benchmark
|
||||
|
||||
This result is design for test the performance of the roadsign.
|
||||
Welcome to contribute more tests of others reverse proxy software!
|
||||
|
||||
## Platform
|
||||
|
||||
All tests are running on my workstation:
|
||||
|
||||
```text
|
||||
.., LittleSheep@PEROPERO-WORKSTATION
|
||||
....,,:;+ccllll --------------------------------
|
||||
...,,+:; cllllllllllllllllll OS: Windows 10 Pro x86_64
|
||||
,cclllllllllll lllllllllllllllllll Host: LENOVO 82TF
|
||||
llllllllllllll lllllllllllllllllll Kernel: 10.0.19045
|
||||
llllllllllllll lllllllllllllllllll Uptime: 1 hour, 22 mins
|
||||
llllllllllllll lllllllllllllllllll Shell: pwsh 7.4.0
|
||||
llllllllllllll lllllllllllllllllll Resolution: 2560x1600
|
||||
llllllllllllll lllllllllllllllllll DE: Aero
|
||||
WM: Explorer
|
||||
llllllllllllll lllllllllllllllllll WM Theme: Custom
|
||||
llllllllllllll lllllllllllllllllll Terminal: Windows Terminal
|
||||
llllllllllllll lllllllllllllllllll CPU: 12th Gen Intel i7-12700H (20) @ 2.690GHz
|
||||
llllllllllllll lllllllllllllllllll GPU: Caption
|
||||
llllllllllllll lllllllllllllllllll GPU: NVIDIA GeForce RTX 3070 Laptop GPU
|
||||
`'ccllllllllll lllllllllllllllllll GPU
|
||||
`' \*:: :ccllllllllllllllll Memory: 7318MiB / 16192MiB
|
||||
````''*::cll
|
||||
``
|
||||
```
|
||||
|
||||
## Results
|
||||
|
||||
The tests are run in the order `nginx -> roadsign without prefork -> roadsign with prefork`. There is no reason why nginx performance should be affected by hardware temperature.
|
||||
|
||||
### Nginx
|
||||
|
||||
```shell
|
||||
go-wrk -c 60 -d 120 http://localhost:8001
|
||||
# => Running 120s test @ http://localhost:8001
|
||||
# => 60 goroutine(s) running concurrently
|
||||
# => 515749 requests in 1m59.953302003s, 245.92MB read
|
||||
# => Requests/sec: 4299.58
|
||||
# => Transfer/sec: 2.05MB
|
||||
# => Avg Req Time: 13.954846ms
|
||||
# => Fastest Request: 0s
|
||||
# => Slowest Request: 410.6972ms
|
||||
# => Number of Errors: 0
|
||||
```
|
||||
|
||||
### RoadSign
|
||||
|
||||
```shell
|
||||
go-wrk -c 60 -d 120 http://localhost:8000
|
||||
# => Running 120s test @ http://localhost:8000
|
||||
# => 60 goroutine(s) running concurrently
|
||||
# => 3256820 requests in 1m59.446620043s, 1.43GB read
|
||||
# => Requests/sec: 27265.90
|
||||
# => Transfer/sec: 12.27MB
|
||||
# => Avg Req Time: 2.20055ms
|
||||
# => Fastest Request: 0s
|
||||
# => Slowest Request: 56.8726ms
|
||||
# => Number of Errors: 0
|
||||
```
|
||||
|
||||
### RoadSign w/ Prefork
|
||||
|
||||
```shell
|
||||
go-wrk -c 60 -d 120 http://localhost:8000
|
||||
# => Running 120s test @ http://localhost:8000
|
||||
# => 60 goroutine(s) running concurrently
|
||||
# => 2188594 requests in 1m59.933175915s, 985.16MB read
|
||||
# => Requests/sec: 18248.45
|
||||
# => Transfer/sec: 8.21MB
|
||||
# => Avg Req Time: 3.287951ms
|
||||
# => Fastest Request: 0s
|
||||
# => Slowest Request: 121.5189ms
|
||||
# => Number of Errors: 0
|
||||
```
|
12
test/benchmark/data/index.html
Normal file
12
test/benchmark/data/index.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Hello, World!</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello, there!</p>
|
||||
<p>Here's the roadsign vs. nginx benchmarking test data!</p>
|
||||
</body>
|
||||
</html>
|
117
test/benchmark/nginx/nginx.conf
Normal file
117
test/benchmark/nginx/nginx.conf
Normal file
@ -0,0 +1,117 @@
|
||||
|
||||
#user nobody;
|
||||
worker_processes 1;
|
||||
|
||||
#error_log logs/error.log;
|
||||
#error_log logs/error.log notice;
|
||||
#error_log logs/error.log info;
|
||||
|
||||
#pid logs/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
# '$status $body_bytes_sent "$http_referer" '
|
||||
# '"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
#access_log logs/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
#keepalive_timeout 0;
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
server {
|
||||
listen 8001;
|
||||
server_name localhost;
|
||||
|
||||
#charset koi8-r;
|
||||
|
||||
#access_log logs/host.access.log main;
|
||||
|
||||
location / {
|
||||
root ../data;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
|
||||
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
|
||||
#
|
||||
#location ~ \.php$ {
|
||||
# proxy_pass http://127.0.0.1;
|
||||
#}
|
||||
|
||||
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
|
||||
#
|
||||
#location ~ \.php$ {
|
||||
# root html;
|
||||
# fastcgi_pass 127.0.0.1:9000;
|
||||
# fastcgi_index index.php;
|
||||
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
|
||||
# include fastcgi_params;
|
||||
#}
|
||||
|
||||
# deny access to .htaccess files, if Apache's document root
|
||||
# concurs with nginx's one
|
||||
#
|
||||
#location ~ /\.ht {
|
||||
# deny all;
|
||||
#}
|
||||
}
|
||||
|
||||
|
||||
# another virtual host using mix of IP-, name-, and port-based configuration
|
||||
#
|
||||
#server {
|
||||
# listen 8000;
|
||||
# listen somename:8080;
|
||||
# server_name somename alias another.alias;
|
||||
|
||||
# location / {
|
||||
# root html;
|
||||
# index index.html index.htm;
|
||||
# }
|
||||
#}
|
||||
|
||||
|
||||
# HTTPS server
|
||||
#
|
||||
#server {
|
||||
# listen 443 ssl;
|
||||
# server_name localhost;
|
||||
|
||||
# ssl_certificate cert.pem;
|
||||
# ssl_certificate_key cert.key;
|
||||
|
||||
# ssl_session_cache shared:SSL:1m;
|
||||
# ssl_session_timeout 5m;
|
||||
|
||||
# ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
# ssl_prefer_server_ciphers on;
|
||||
|
||||
# location / {
|
||||
# root html;
|
||||
# index index.html index.htm;
|
||||
# }
|
||||
#}
|
||||
|
||||
}
|
20
test/benchmark/roadsign-with-prefork/config/example.json
Normal file
20
test/benchmark/roadsign-with-prefork/config/example.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "Example Site",
|
||||
"rules": [
|
||||
{
|
||||
"host": [
|
||||
"localhost:8000"
|
||||
],
|
||||
"path": [
|
||||
"/"
|
||||
]
|
||||
}
|
||||
],
|
||||
"upstreams": [
|
||||
{
|
||||
"id": "example",
|
||||
"name": "Benchmarking Data",
|
||||
"uri": "files://../data"
|
||||
}
|
||||
]
|
||||
}
|
25
test/benchmark/roadsign-with-prefork/settings.yml
Normal file
25
test/benchmark/roadsign-with-prefork/settings.yml
Normal file
@ -0,0 +1,25 @@
|
||||
debug:
|
||||
print_routes: false
|
||||
hypertext:
|
||||
administration_ports: []
|
||||
administration_secured_ports: []
|
||||
certificate:
|
||||
administration_key: ./cert.key
|
||||
administration_pem: ./cert.pem
|
||||
key: ./cert.key
|
||||
pem: ./cert.pem
|
||||
limitation:
|
||||
max_body_size: -1
|
||||
max_qps: -1
|
||||
ports:
|
||||
- :8000
|
||||
secured_ports: []
|
||||
paths:
|
||||
configs: ./config
|
||||
performance:
|
||||
network_timeout: 3000
|
||||
prefork: true
|
||||
security:
|
||||
administration_trusted_proxies:
|
||||
- localhost
|
||||
credential: e81f43f32d934271af6322e5376f5f59
|
20
test/benchmark/roadsign/config/example.json
Normal file
20
test/benchmark/roadsign/config/example.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "Example Site",
|
||||
"rules": [
|
||||
{
|
||||
"host": [
|
||||
"localhost:8000"
|
||||
],
|
||||
"path": [
|
||||
"/"
|
||||
]
|
||||
}
|
||||
],
|
||||
"upstreams": [
|
||||
{
|
||||
"id": "example",
|
||||
"name": "Benchmarking Data",
|
||||
"uri": "files://../data"
|
||||
}
|
||||
]
|
||||
}
|
25
test/benchmark/roadsign/settings.yml
Normal file
25
test/benchmark/roadsign/settings.yml
Normal file
@ -0,0 +1,25 @@
|
||||
debug:
|
||||
print_routes: false
|
||||
hypertext:
|
||||
administration_ports: []
|
||||
administration_secured_ports: []
|
||||
certificate:
|
||||
administration_key: ./cert.key
|
||||
administration_pem: ./cert.pem
|
||||
key: ./cert.key
|
||||
pem: ./cert.pem
|
||||
limitation:
|
||||
max_body_size: -1
|
||||
max_qps: -1
|
||||
ports:
|
||||
- :8000
|
||||
secured_ports: []
|
||||
paths:
|
||||
configs: ./config
|
||||
performance:
|
||||
network_timeout: 3000
|
||||
prefork: false
|
||||
security:
|
||||
administration_trusted_proxies:
|
||||
- localhost
|
||||
credential: e81f43f32d934271af6322e5376f5f59
|
Reference in New Issue
Block a user