Ran with wrk http://localhost:/_matrix/media/r0/ -c64 -t8 -d1m, for a 1 minute benchmark across 8 threads, with 64 requests open at a time. **synapse-media-proxy refactor** ``` Running 1m test @ download/pixie.town/Nrp1oyUgHirgm7gDSlDvHutM 8 threads and 64 connections Thread Stats Avg Stdev Max +/- Stdev Latency 137.02ms 51.40ms 826.66ms 98.06% Req/Sec 60.67 11.64 90.00 80.03% 28740 requests in 1.00m, 170.97GB read Requests/sec: 478.23 Transfer/sec: 2.84GB Running 1m test @ thumbnail/pixie.town/OjN4zjsGXzSZBkLBsHh5REJi?height=128&width=128 8 threads and 64 connections Thread Stats Avg Stdev Max +/- Stdev Latency 12.99ms 16.72ms 371.69ms 99.23% Req/Sec 682.69 65.13 808.00 88.66% 324549 requests in 1.00m, 1.36GB read Requests/sec: 5405.62 Transfer/sec: 23.18MB ``` **synapse-media-proxy original** ``` Running 1m test @ download/pixie.town/Nrp1oyUgHirgm7gDSlDvHutM 8 threads and 64 connections Thread Stats Avg Stdev Max +/- Stdev Latency 398.98ms 47.92ms 874.86ms 96.83% Req/Sec 25.00 17.51 70.00 74.47% 9612 requests in 1.00m, 57.22GB read Requests/sec: 160.01 Transfer/sec: 0.95GB Running 1m test @ thumbnail/pixie.town/OjN4zjsGXzSZBkLBsHh5REJi?height=128&width=128 8 threads and 64 connections Thread Stats Avg Stdev Max +/- Stdev Latency 1.47s 72.76ms 2.00s 96.48% Req/Sec 14.74 12.64 70.00 54.84% 2588 requests in 1.00m, 8.31MB read Socket errors: connect 0, read 0, write 0, timeout 3 Requests/sec: 43.07 Transfer/sec: 141.64KB ``` **Synapse** ``` Running 1m test @ download/pixie.town/Nrp1oyUgHirgm7gDSlDvHutM 8 threads and 64 connections Thread Stats Avg Stdev Max +/- Stdev Latency 1.06s 61.43ms 1.33s 81.81% Req/Sec 14.13 14.20 70.00 81.42% 3585 requests in 1.00m, 21.66GB read Requests/sec: 59.71 Transfer/sec: 369.38MB Running 1m test @ thumbnail/pixie.town/OjN4zjsGXzSZBkLBsHh5REJi?height=128&width=128 8 threads and 64 connections Thread Stats Avg Stdev Max +/- Stdev Latency 206.96ms 101.69ms 1.38s 97.21% Req/Sec 41.42 16.39 80.00 61.90% 19278 requests in 1.00m, 15.42MB read Non-2xx or 3xx responses: 19278 Requests/sec: 321.01 Transfer/sec: 263.01KB ``` (note a lot of those requests returned non-2xx/3xx responses, failing to thumbnail)