librespeed / speedtest-go

Go backend for LibreSpeed
GNU Lesser General Public License v3.0
733 stars 157 forks source link

enabling tls/ssl causes significant drop in performance #49

Open budachst opened 2 years ago

budachst commented 2 years ago

Description

Downloaded the latest release which has the tls option and set up speedtest-go using tls/http2 using Letsencrypt certificates. This caused the download speeds to drop to approx. 66% and upload speeds to as low as 30%, compared to non-tls settings.

Server

Running on a LXC Rocky 8.6 Linux install

Client

Firefox 102.01 on macOS Monteray

Steps to reproduce

Expected behaviour

Expected mostly the same up- and download speeds over tls or plain

Bildschirmfoto 2022-07-24 um 19 13 39

Screenshots

Added screenshots for wired and wireless tests. Lefts ones are without tls, right ones with tls/http2 enabled. Top ones are wired connections, bottom ones are on wireless.

wen-long commented 1 year ago

HTTP2 Multiplexing mux multi http connection to one connection. Thus, speedtest result will always same as a single connection test result. some technique to solve this, like use different domain, such as cdn1.example.com,cdn2.example.com,cdn2.example.com browser treat them as different host despite their A record points to same host. therefore browser can make multi connection to same host