Skip to content

Instantly share code, notes, and snippets.

@ddragosd
Created July 24, 2019 12:48
Show Gist options
  • Save ddragosd/9867f09e71ff19e5da0a0e4849caaccc to your computer and use it in GitHub Desktop.
Save ddragosd/9867f09e71ff19e5da0a0e4849caaccc to your computer and use it in GitHub Desktop.
Quick Envoy load test
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address:
protocol: TCP
address: 0.0.0.0
port_value: 9000
static_resources:
listeners:
- name: listener_0
address:
socket_address:
protocol: TCP
address: 0.0.0.0
port_value: 9191
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
stat_prefix: ingress_http
route_config:
name: test_out
codec_type: AUTO
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match:
prefix: "/test"
route:
cluster: local_cluster
http_filters:
- name: envoy.router
clusters:
- name: local_cluster
connect_timeout: 1.25s
type: STATIC
max_requests_per_connection: 2000
max_concurent_streams: 2000
# Comment out the following line to test on v6 networks
lb_policy: ROUND_ROBIN
hosts:
- socket_address:
address: 172.17.0.1
port_value: 8080
envoy:
docker run --rm -p 9191:9191 --ulimit nofile=1024000:1024000 -v `pwd`/envoy.yaml:/etc/envoy/envoy.yaml --entrypoint envoy envoyproxy/envoy:latest -c /etc/envoy/envoy.yaml -l off --concurrency 4
nginx:
docker run -p 8080:8080 --rm --ulimit nofile=1024000:1024000 -v `pwd`/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf brndnmtthws/nginx-echo-headers
test-envoy:
docker run --rm williamyeh/wrk:4.0.1 -t4 -c1000 -d30s --latency http://172.17.0.1:9191/test
test-nginx:
docker run --rm hugotr/wrk2:latest -t4 -c1000 -d30s --latency http://172.17.0.1:8080/test
error_log stderr debug;
worker_processes 2;
events {
worker_connections 4096;
}
http {
access_log off;
error_log /dev/stderr crit;
include mime.types;
server {
listen 8080;
location / {
echo_duplicate 1 $echo_client_request_headers;
echo "\r";
echo_read_request_body;
echo $request_body;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment