Browse Source

reduce test runs of OCaml Webmachine & use pre-built image (#7822)

Robin Björklin 2 years ago
parent
commit
f11a23164b

+ 0 - 42
frameworks/OCaml/webmachine/benchmark_config.json

@@ -21,48 +21,6 @@
         "display_name": "webmachine",
         "notes": "",
         "versus": "None"
-      },
-      "haproxy": {
-        "json_url": "/json",
-        "plaintext_url": "/plaintext",
-        "db_url": "/db",
-        "query_url": "/queries/",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Micro",
-        "database": "postgres",
-        "framework": "webmachine",
-        "language": "OCaml",
-        "flavor": "None",
-        "orm": "Raw",
-        "platform": "cohttp",
-        "webserver": "haproxy",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "webmachine-haproxy",
-        "notes": "",
-        "versus": "None"
-      },
-      "flambda": {
-        "json_url": "/json",
-        "plaintext_url": "/plaintext",
-        "db_url": "/db",
-        "query_url": "/queries/",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Micro",
-        "database": "postgres",
-        "framework": "webmachine",
-        "language": "OCaml",
-        "flavor": "None",
-        "orm": "Raw",
-        "platform": "cohttp",
-        "webserver": "haproxy",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "webmachine-flambda",
-        "notes": "",
-        "versus": "None"
       }
   }]
 }

+ 0 - 30
frameworks/OCaml/webmachine/config.toml

@@ -15,33 +15,3 @@ orm = "Raw"
 platform = "cohttp"
 webserver = "None"
 versus = "None"
-
-[haproxy]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries/"
-approach = "Realistic"
-classification = "Micro"
-database = "postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "cohttp"
-webserver = "haproxy"
-versus = "None"
-
-[flambda]
-urls.plaintext = "/plaintext"
-urls.json = "/json"
-urls.db = "/db"
-urls.query = "/queries/"
-approach = "Realistic"
-classification = "Micro"
-database = "postgres"
-database_os = "Linux"
-os = "Linux"
-orm = "Raw"
-platform = "cohttp"
-webserver = "haproxy"
-versus = "None"

+ 0 - 57
frameworks/OCaml/webmachine/haproxy.cfg

@@ -1,57 +0,0 @@
-global
-    chroot      /var/lib/haproxy
-    pidfile     /var/run/haproxy.pid
-    maxconn     32768
-    user        haproxy
-    group       haproxy
-
-defaults
-    mode                    tcp
-    log                     global
-    option                  dontlognull
-    option http-server-close
-    option                  redispatch
-    retries                 3
-    timeout http-request    10s
-    timeout queue           1m
-    timeout connect         10s
-    timeout client          1m
-    timeout server          1m
-    timeout http-keep-alive 10s
-    timeout check           10s
-    maxconn                 32768
-
-frontend main
-    bind *:8080
-    default_backend             tfb
-
-backend tfb
-    balance     static-rr
-    server  tfb0 127.0.0.1:9000 check
-    server  tfb1 127.0.0.1:9001 check
-    server  tfb2 127.0.0.1:9002 check
-    server  tfb3 127.0.0.1:9003 check
-    server  tfb4 127.0.0.1:9004 check
-    server  tfb5 127.0.0.1:9005 check
-    server  tfb6 127.0.0.1:9006 check
-    server  tfb7 127.0.0.1:9007 check
-    server  tfb8 127.0.0.1:9008 check
-    server  tfb9 127.0.0.1:9009 check
-    server  tfb10 127.0.0.1:9010 check
-    server  tfb11 127.0.0.1:9011 check
-    server  tfb12 127.0.0.1:9012 check
-    server  tfb13 127.0.0.1:9013 check
-    server  tfb14 127.0.0.1:9014 check
-    server  tfb15 127.0.0.1:9015 check
-    server  tfb16 127.0.0.1:9016 check
-    server  tfb17 127.0.0.1:9017 check
-    server  tfb18 127.0.0.1:9018 check
-    server  tfb19 127.0.0.1:9019 check
-    server  tfb20 127.0.0.1:9020 check
-    server  tfb21 127.0.0.1:9021 check
-    server  tfb22 127.0.0.1:9022 check
-    server  tfb23 127.0.0.1:9023 check
-    server  tfb24 127.0.0.1:9024 check
-    server  tfb25 127.0.0.1:9025 check
-    server  tfb26 127.0.0.1:9026 check
-    server  tfb27 127.0.0.1:9027 check

+ 0 - 13
frameworks/OCaml/webmachine/start-servers.sh

@@ -1,13 +0,0 @@
-#!/bin/sh
-
-CMD=$1
-CPU_COUNT=$(nproc)
-P=9000
-END=$(($P+$CPU_COUNT))
-
-while [ $P -lt $END ]; do
-  PORT=$P $CMD &
-  P=$((P+1))
-done
-sleep 2
-exec /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid

+ 0 - 47
frameworks/OCaml/webmachine/webmachine-flambda.dockerfile

@@ -1,47 +0,0 @@
-FROM ocaml/opam:debian-10-ocaml-4.12-flambda
-
-ENV DIR project
-# https://blog.packagecloud.io/eng/2017/02/21/set-environment-variable-save-thousands-of-system-calls/
-ENV TZ  :/etc/localtime
-
-# https://caml.inria.fr/pub/docs/manual-ocaml/libref/Gc.html
-# https://linux.die.net/man/1/ocamlrun
-# https://blog.janestreet.com/memory-allocator-showdown/
-ENV OCAMLRUNPARAM a=2,o=240
-
-ENV PKGS="\
-atdgen>=2.2.1 \
-atdgen-runtime>=2.2.1 \
-caqti>=1.6.0 \
-caqti-driver-postgresql>=1.6.0 \
-caqti-lwt>=1.6.0 \
-cohttp-lwt-unix>=4.0.0 \
-conf-libev>=4-12 \
-dune>=2.8.5 \
-httpaf>=0.7.1 \
-httpaf-lwt-unix>=0.7.1 \
-lwt>=5.4.1 \
-lwt_ppx>=2.0.2 \
-opium>=0.20.0 \
-ppx_deriving_yojson>=3.6.1 \
-ppx_rapper>=3.0.0 \
-tiny_httpd>=0.8 \
-tyxml>=4.5.0 \
-webmachine>=0.7.0 \
-yojson>=1.7.0 \
-"
-
-RUN \
-  opam update && \
-  opam depext $PKGS && \
-  opam install $PKGS
-
-WORKDIR /${DIR}
-
-COPY ./src /${DIR}
-
-RUN sudo chown -R opam: . && make build
-
-EXPOSE 8080
-
-ENTRYPOINT ["_build/default/src/bin/tfb.exe"]

+ 0 - 59
frameworks/OCaml/webmachine/webmachine-haproxy.dockerfile

@@ -1,59 +0,0 @@
-FROM ocaml/opam:debian-10-ocaml-4.12
-
-ENV DIR project
-# https://blog.packagecloud.io/eng/2017/02/21/set-environment-variable-save-thousands-of-system-calls/
-ENV TZ  :/etc/localtime
-
-# https://caml.inria.fr/pub/docs/manual-ocaml/libref/Gc.html
-# https://linux.die.net/man/1/ocamlrun
-# https://blog.janestreet.com/memory-allocator-showdown/
-ENV OCAMLRUNPARAM a=2,o=240
-
-ENV PKGS="\
-atdgen>=2.2.1 \
-atdgen-runtime>=2.2.1 \
-caqti>=1.6.0 \
-caqti-driver-postgresql>=1.6.0 \
-caqti-lwt>=1.6.0 \
-cohttp-lwt-unix>=4.0.0 \
-conf-libev>=4-12 \
-dune>=2.8.5 \
-httpaf>=0.7.1 \
-httpaf-lwt-unix>=0.7.1 \
-lwt>=5.4.1 \
-lwt_ppx>=2.0.2 \
-opium>=0.20.0 \
-ppx_deriving_yojson>=3.6.1 \
-ppx_rapper>=3.0.0 \
-tiny_httpd>=0.8 \
-tyxml>=4.5.0 \
-webmachine>=0.7.0 \
-yojson>=1.7.0 \
-"
-
-RUN \
-  opam update && \
-  opam depext $PKGS && \
-  opam install $PKGS
-
-WORKDIR /${DIR}
-
-COPY ./src /${DIR}
-
-RUN sudo chown -R opam: . && make build
-
-EXPOSE 8080
-
-# try to keep everything above here in sync with other dockerfiles in project for more efficent use of docker build cache
-
-# This makes the program only spawn one child process to serve requests
-ENV APP_INSTANCES 1
-
-USER root
-
-RUN apt-get update && apt-get install -y haproxy
-COPY haproxy.cfg /etc/haproxy/haproxy.cfg
-COPY start-servers.sh ./start-servers.sh
-RUN chown -R opam: . && chmod +x ./start-servers.sh
-
-ENTRYPOINT ["/project/start-servers.sh", "_build/default/src/bin/tfb.exe"]

+ 4 - 31
frameworks/OCaml/webmachine/webmachine.dockerfile

@@ -1,46 +1,19 @@
-FROM ocaml/opam:debian-10-ocaml-4.12
+# https://github.com/rbjorklin/techempower-ocaml-image
+# Use pre-built image with all dependencies for faster test times
+FROM rbjorklin/techempower-ocaml-image:4.14.1-4bf86567
 
 ENV DIR project
-# https://blog.packagecloud.io/eng/2017/02/21/set-environment-variable-save-thousands-of-system-calls/
-ENV TZ  :/etc/localtime
 
 # https://caml.inria.fr/pub/docs/manual-ocaml/libref/Gc.html
 # https://linux.die.net/man/1/ocamlrun
 # https://blog.janestreet.com/memory-allocator-showdown/
 ENV OCAMLRUNPARAM a=2,o=240
 
-ENV PKGS="\
-atdgen>=2.2.1 \
-atdgen-runtime>=2.2.1 \
-caqti>=1.6.0 \
-caqti-driver-postgresql>=1.6.0 \
-caqti-lwt>=1.6.0 \
-cohttp-lwt-unix>=4.0.0 \
-conf-libev>=4-12 \
-dune>=2.8.5 \
-httpaf>=0.7.1 \
-httpaf-lwt-unix>=0.7.1 \
-lwt>=5.4.1 \
-lwt_ppx>=2.0.2 \
-opium>=0.20.0 \
-ppx_deriving_yojson>=3.6.1 \
-ppx_rapper>=3.0.0 \
-tiny_httpd>=0.8 \
-tyxml>=4.5.0 \
-webmachine>=0.7.0 \
-yojson>=1.7.0 \
-"
-
-RUN \
-  opam update && \
-  opam depext $PKGS && \
-  opam install $PKGS
-
 WORKDIR /${DIR}
 
 COPY ./src /${DIR}
 
-RUN sudo chown -R opam: . && make build
+RUN make build
 
 EXPOSE 8080