add bench docker

This commit is contained in:
Jun Kurihara 2022-06-28 00:58:05 -04:00
commit 7172f932ca
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
8 changed files with 78 additions and 8 deletions

13
bench/bench.sh Normal file
View file

@ -0,0 +1,13 @@
#!/bin/sh
echo "----------------------------"
echo "Benchmark on rpxy"
ab -c 32 -n 10000 http://127.0.0.1:8080/
echo "----------------------------"
echo "Benchmark on nginx"
ab -c 32 -n 10000 http://127.0.0.1:8090/
echo "----------------------------"
echo "Benchmark on caddy"
ab -c 32 -n 10000 http://127.0.0.1:8100/

View file

@ -15,13 +15,31 @@ services:
options:
max-size: "10m"
max-file: "3"
networks:
bench-nw:
ipv4_address: 192.168.100.100
rpxy-rp:
image: jqtype/rpxy
container_name: proxy-rpxy
build:
context: ../
restart: unless-stopped
ports:
- 127.0.0.1:8080:8080
tty: false
privileged: true
volumes:
- ./rpxy.toml:/etc/rpxy.toml:ro
networks:
bench-nw:
nginx-rp:
image: jwilder/nginx-proxy:alpine
container_name: proxy-nginx
ports:
- 127.0.0.1:8090:80
restart: always
restart: unless-stopped
tty: false
privileged: true
volumes:
@ -30,6 +48,8 @@ services:
options:
max-size: "10m"
max-file: "3"
networks:
bench-nw:
caddy-rp:
image: caddy:2
@ -40,3 +60,14 @@ services:
tty: false
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
networks:
bench-nw:
networks:
bench-nw:
name: bench-nw
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.100.0/24

17
bench/rpxy.toml Normal file
View file

@ -0,0 +1,17 @@
listen_port = 8080
listen_port_tls = 8443
listen_ipv6 = false
max_concurrent_streams = 128
max_clients = 512
[apps]
[apps.localhost]
server_name = 'localhost'
reverse_proxy = [
# default destination if path is not specified
# Array for load balancing
{ upstream = [{ location = '192.168.100.100', tls = false }] },
]