Jump to content

User:FFurnari-WMF/HaproxyAWSLC

From Wikitech

Performance comparison between HAProxy 3.2 + OpenSSL 3.5 vs HAProxy 3.2 + AWS-LC (Debian Trixie)

Host setup

  • Using cp2041 and cp2042 to host, respectively, HAProxy 3.2 + OpenSSL 3.5 and HAProxy 3.2 + AWS-LC. These hosts are depooled and waiting to be decommissioned.
  • On both hosts:
    • Puppet has been disabled
    • HaproxyKafka service has been stopped and disabled to avoid polluting metrics
    • haproxy-mtail service has been stopped and disabled to avoid polluting metrics
    • Installed (manually) python3.13-venv to run benchmark script
    • Fetched benchmark script from GitLab repo
    • Created a Python virtualenv and installed requirements for the script above
    • Compiled a curl version against OpenSSL 1.1.1 to test the impact of OpenSSL version on the client side and not be bound on the (slowness?) of the OpenSSL version to pollute the results.
  • On cp2041:
  • On cp2042:
    • Installed haproxy-awslc (official HAProxy performance packages), haproxy-awslc, libssl-awslc
    • Changed HAProxy configuration to adapt to AWS-LC:
      @@ -26,7 +26,7 @@
           ssl-default-bind-options ssl-min-ver TLSv1.2 ssl-max-ver TLSv1.3
           ssl-default-bind-ciphers -ALL:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256
           ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384
      -    #ssl-dh-param-file /etc/ssl/dhparam.pem
      +    ssl-dh-param-file /etc/ssl/dhparam.pem
           tune.ssl.cachesize 512000
           tune.ssl.lifetime 86400
           maxconn 200000
      
    • Set /etc/default/haproxy back to using EXTRAOPTS (overridden by haproxy-awslc package?): EXTRAOPTS="-f /etc/haproxy/conf.d"
    • Created /etc/systemd/system/haproxy.service (copied from other hosts' /lib/systemd/system/haproxy.service)

Run the benchmark script

  • On both hosts: remember to unset the envvars: HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy, NO_PROXY, no_proxy
  • Number of requests issued is always 10M, with fixed concurrency at 10k concurrent requests.
  • Run the test from the "other" host:
    • From cp2041 test HAProxy + AWSLC with both curl + OpenSSL 3.5 and curl + OpenSSL 1.1.1:
      • benchmark-curl.py --concurrency 10000 --target https://upload.wikimedia.org/nonexistant --resolve upload.wikipedia.org:443:10.192.48.157 --num-requests 10000000 --http-version 2 --header nonexistant --curl /home/fabfur/curl-1.1.1 --label "client: curl (openssl 1.1.1), server: haproxy (awslc)"
      • benchmark-curl.py --concurrency 10000 --target https://upload.wikimedia.org/nonexistant --resolve upload.wikipedia.org:443:10.192.48.157 --num-requests 10000000 --http-version 2 --header nonexistant --label "client: curl (openssl 3.5), server: haproxy (awslc)"
    • From cp2042 test HAProxy + OpenSSL 3.5 with both curl + OpenSSL 3.5 and curl + OpenSSL 1.1.1:
      • benchmark-curl.py --concurrency 10000 --target https://en.wikipedia.org/nonexistent --resolve en.wikipedia.org:443:10.192.48.156 --num-requests 10000000 --http-version 2 --header 'nonexistant' --curl /home/fabfur/curl-1.1.1 --label "client: curl (openssl 1.1.1), server: haproxy (openssl 3.5)"
      • benchmark-curl.py --concurrency 10000 --target https://en.wikipedia.org/nonexistent --resolve en.wikipedia.org:443:10.192.48.156 --num-requests 10000000 --http-version 2 --header 'nonexistant'--label "client: curl (openssl 3.5), server: haproxy (openssl 3.5)"


Results: