From 400fc81c5c71cc9c551c98054eb328bd3542809f Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Thu, 23 Dec 2021 02:13:15 +0200 Subject: [PATCH] [benchmarks] Add NGinx dummy configuration. --- examples/{haproxy.conf => haproxy-dummy.conf} | 0 examples/nginx-dummy.conf | 91 +++++++++++++++++++ examples/nginx.conf | 3 +- scripts/benchmark.z-run | 25 ++++- 4 files changed, 116 insertions(+), 3 deletions(-) rename examples/{haproxy.conf => haproxy-dummy.conf} (100%) create mode 100644 examples/nginx-dummy.conf diff --git a/examples/haproxy.conf b/examples/haproxy-dummy.conf similarity index 100% rename from examples/haproxy.conf rename to examples/haproxy-dummy.conf diff --git a/examples/nginx-dummy.conf b/examples/nginx-dummy.conf new file mode 100644 index 0000000..dedb34c --- /dev/null +++ b/examples/nginx-dummy.conf @@ -0,0 +1,91 @@ + + +http { + + + root /var/lib/empty; + + index index.html index.txt; + autoindex off; + include /dev/null; + default_type application/octet-stream; + + gzip off; + gzip_buffers 128 16k; + gzip_comp_level 9; + gzip_min_length 0; + gzip_proxied any; + gzip_types *; + + server { + + + listen 127.9.185.194:8080 default_server bind backlog=65536; + + server_name nginx; + server_tokens off; + server_name_in_redirect off; + port_in_redirect off; + + keepalive_requests 262144; + keepalive_timeout 60s; + + tcp_nodelay off; + tcp_nopush off; + + sendfile off; + directio off; + aio off; + + open_file_cache max=2048 inactive=60s; + open_file_cache_valid 60s; + open_file_cache_min_uses 1; + open_file_cache_errors on; + output_buffers 4 128k; + postpone_output 16k; + read_ahead 1; + + + location / { + + limit_except GET HEAD { + deny all; + } + + default_type "text/plain; charset=utf-8"; + add_header "Content-Encoding" "identity"; + add_header "Cache-Control" "no-store, max-age=0"; + return 200 "hello world!\n"; + } + + } + + + error_log /dev/stderr notice; + access_log off; + log_not_found on; + + client_body_temp_path /var/lib/empty; + proxy_temp_path /var/lib/empty; + fastcgi_temp_path /var/lib/empty; + uwsgi_temp_path /var/lib/empty; + scgi_temp_path /var/lib/empty; +} + + +worker_processes 2; +worker_rlimit_nofile 131072; +working_directory /var/lib/empty; + +error_log /dev/stderr notice; +pid /tmp/nginx.pid; +daemon off; + + +events { + use epoll; + worker_connections 16640; + accept_mutex off; + multi_accept off; +} + diff --git a/examples/nginx.conf b/examples/nginx.conf index 6544810..54d32fc 100644 --- a/examples/nginx.conf +++ b/examples/nginx.conf @@ -20,9 +20,10 @@ http { server { - listen 127.9.185.194:8080 default_server bind backlog=65536; + listen @{bind_ip}:@{bind_port} default_server bind backlog=65536; server_name nginx; + server_tokens off; server_name_in_redirect off; port_in_redirect off; diff --git a/scripts/benchmark.z-run b/scripts/benchmark.z-run index 6caff01..e269f8e 100644 --- a/scripts/benchmark.z-run +++ b/scripts/benchmark.z-run @@ -331,7 +331,7 @@ -<< benchmark / alternatives / haproxy +<< benchmark / alternatives / haproxy-dummy exec -- \ sudo -u root -n -E -P -- \ taskset -c 0,1 \ @@ -343,7 +343,28 @@ env -i -- \ ./.bin/haproxy \ -db \ - -f ./examples/haproxy.conf \ + -f ./examples/haproxy-dummy.conf \ + "${@}" \ + # +!! + + + + +<< benchmark / alternatives / nginx-dummy + exec -- \ + sudo -u root -n -E -P -- \ + taskset -c 0,1 \ + nice -n -19 -- \ + ionice -c 2 -n 0 -- \ + chrt -r 10 \ + prlimit -n262144 -- \ + sudo -u "${USER}" -n -E -P -- \ + env -i -- \ + ./.bin/nginx \ + -c ./examples/nginx-dummy.conf \ + -e /dev/stderr \ + -p . \ "${@}" \ # !!