summaryrefslogtreecommitdiffhomepage
path: root/images/benchmarks
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2020-09-02 11:20:45 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-02 11:22:17 -0700
commitb9b6660dc4ec0cee77bb30ac7a44c061ada1b3d6 (patch)
treefee986153a27c8cbef8002dc808fc8e4dc21b965 /images/benchmarks
parent8ab08cdc01e2e4b36a050ffc3acad682aebaa7b5 (diff)
Add Docs to nginx benchmark.
Adds docs to nginx and refactors both Httpd and Nginx benchmarks. Key changes: - Add docs and make nginx tests the same as httpd (reverse, all docs, etc.). - Make requests scale on c * b.N -> a request per thread. This works well with both --test.benchtime=10m (do a run that lasts at least 10m) and --test.benchtime=10x (do b.N = 10). -- Remove a doc from both tests (1000Kb) as 1024Kb exists. PiperOrigin-RevId: 329751091
Diffstat (limited to 'images/benchmarks')
-rw-r--r--images/benchmarks/httpd/Dockerfile2
-rw-r--r--images/benchmarks/nginx/Dockerfile10
-rw-r--r--images/benchmarks/nginx/nginx.conf19
3 files changed, 30 insertions, 1 deletions
diff --git a/images/benchmarks/httpd/Dockerfile b/images/benchmarks/httpd/Dockerfile
index b72406012..e95538a40 100644
--- a/images/benchmarks/httpd/Dockerfile
+++ b/images/benchmarks/httpd/Dockerfile
@@ -8,7 +8,7 @@ RUN set -x \
# Generate a bunch of relevant files.
RUN mkdir -p /local && \
- for size in 1 10 100 1000 1024 10240; do \
+ for size in 1 10 100 1024 10240; do \
dd if=/dev/zero of=/local/latin${size}k.txt count=${size} bs=1024; \
done
diff --git a/images/benchmarks/nginx/Dockerfile b/images/benchmarks/nginx/Dockerfile
index b64eb52ae..2444d04b1 100644
--- a/images/benchmarks/nginx/Dockerfile
+++ b/images/benchmarks/nginx/Dockerfile
@@ -1 +1,11 @@
FROM nginx:1.15.10
+
+# Generate a bunch of relevant files.
+RUN mkdir -p /local && \
+ for size in 1 10 100 1024 10240; do \
+ dd if=/dev/zero of=/local/latin${size}k.txt count=${size} bs=1024; \
+ done
+
+RUN touch /local/index.html
+
+COPY ./nginx.conf /etc/nginx/nginx.conf
diff --git a/images/benchmarks/nginx/nginx.conf b/images/benchmarks/nginx/nginx.conf
new file mode 100644
index 000000000..2c43c0cda
--- /dev/null
+++ b/images/benchmarks/nginx/nginx.conf
@@ -0,0 +1,19 @@
+user nginx;
+worker_processes 1;
+daemon off;
+
+error_log /var/log/nginx/error.log warn;
+pid /var/run/nginx.pid;
+
+events {
+ worker_connections 1024;
+}
+
+
+http {
+ server {
+ location / {
+ root /tmp/html;
+ }
+ }
+}