diff --git a/.benchmark.swp b/.benchmark.swp deleted file mode 100644 index 196c37f..0000000 Binary files a/.benchmark.swp and /dev/null differ diff --git a/benchmark b/benchmark index 0040f15..cea5269 100755 --- a/benchmark +++ b/benchmark @@ -2,7 +2,7 @@ set -xeuv testUrl=test.fluffyb.net tcpConnections=50 -testLength=60s +testLength=10s proto=("http://" "https://") dataStore=$(pwd)/testData/$(date +%F-%H-%M) size=("1kb" "10kb" "100kb" "1000kb") @@ -26,7 +26,7 @@ do for i in `seq 1 $(($(getconf _NPROCESSORS_ONLN)))`; do testReason="sslTest" - docker run --rm -v $(pwd)/scripts:/root/wrk/scripts git.sethsamuel.online/fluffy/wrk -s /root/wrk/scripts/report.lua -t $i -c $tcpConnections -d $testLength $pr$testUrl/$sz.file >> $dataStore$testReason.csv + docker run --rm -v $(pwd)/scripts:/root/wrk/scripts git.sethsamuel.online/fluffy/wrk -s /root/wrk/scripts/report.lua -H 'Connection: close' -t $i -c $tcpConnections -d $testLength $pr$testUrl/0kb.file >> $dataStore$testReason.csv done done diff --git a/scripts/fullRun.lua b/scripts/fullRun.lua new file mode 100644 index 0000000..6637dc7 --- /dev/null +++ b/scripts/fullRun.lua @@ -0,0 +1,55 @@ +local proto = { "http://", "https://" } +local sizes = { "1kb", "10kb", "100kb", "1000kb" } +local testUrl = "test.fluffyb.net" +local tcpConnections = 50 +local testLength = 60 -- in seconds +local threads = wrk.thread or 4 -- Defaulting to 4 threads if not specified +local testReason = "" + +-- Storage for results +local results = {} + +-- Function to run different tests +function init(args) + results = {} +end + +function request() + -- Cycle through protocol and size combinations + local index = math.random(1, #proto) + local sizeIndex = math.random(1, #sizes) + local url = proto[index] .. testUrl .. "/" .. sizes[sizeIndex] .. ".file" + + return wrk.format("GET", url) +end + +function done(summary, latency, requests) + io.write("------------------------------\n") + + -- Print request results + for _, p in ipairs({ 50, 90, 99, 99.999 }) do + local n = latency:percentile(p) + io.write(string.format("%g%%,%d\n", p, n)) + end + + -- Requests Per Second (RPS) + local duration_in_seconds = summary.duration / 1e6 + local rps = summary.requests / duration_in_seconds + io.write(string.format("Requests per second: %.2f\n", rps)) + + -- Store results + table.insert(results, { + reason = testReason, + requests = summary.requests, + rps = rps, + latency_avg = latency.mean / 1000, + latency_max = latency.max / 1000 + }) + + -- Print results + io.write("\n=== Test Summary ===\n") + for _, result in ipairs(results) do + io.write(string.format("%s - Requests: %d, RPS: %.2f, Latency (avg): %.2f ms, Latency (max): %.2f ms\n", + result.reason, result.requests, result.rps, result.latency_avg, result.latency_max)) + end +end diff --git a/scripts/fullrunV2.lua b/scripts/fullrunV2.lua new file mode 100644 index 0000000..b2e22c3 --- /dev/null +++ b/scripts/fullrunV2.lua @@ -0,0 +1,36 @@ +local proto = { "http://", "https://" } +local sizes = { "1kb", "10kb", "100kb", "1000kb" } +local testUrl = "test.fluffyb.net" + +local current_proto = 1 +local current_size = 1 + +function init(args) + current_proto = 1 + current_size = 1 +end + +function request() + -- Build the URL using the current protocol and file size + local url = proto[current_proto] .. testUrl .. "/" .. sizes[current_size] .. ".file" + + -- Move to the next size + current_size = current_size + 1 + + -- If we've gone through all sizes, move to the next protocol and reset size + if current_size > #sizes then + current_size = 1 + current_proto = current_proto + 1 + end + + -- If we've gone through all protocols, reset everything (looping back) + if current_proto > #proto then + current_proto = 1 + end + + return wrk.format("GET", url) +end + +function done(summary, latency, requests) + io.write(string.format("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n\n",latency.min,latency.mean,latency.max,latency.stdev,latency:percentile(50),latency:percentile(70),latency:percentile(90),latency:percentile(99),summary.requests,summary.bytes)) +end diff --git a/scripts/report.lua b/scripts/report.lua index 2aa9233..0ba4eb4 100644 --- a/scripts/report.lua +++ b/scripts/report.lua @@ -1,4 +1,4 @@ done = function(summary,latency,requests) io.write("------------------------------\n") - io.write(string.format("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n\n",latency.min,latency.mean,latency.max,latency.stdev,latency:percentile(50),latency:percentile(70),latency:percentile(90),latency:percentile(99),summary.requests,summary.bytes)) + io.write(string.format("R: %d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n\n",latency.min,latency.mean,latency.max,latency.stdev,latency:percentile(50),latency:percentile(70),latency:percentile(90),latency:percentile(99),summary.requests,summary.bytes)) end \ No newline at end of file diff --git a/testData/2025-02-04-16-50requestsAndThroughput.csv b/testData/2025-02-04-16-50requestsAndThroughput.csv new file mode 100644 index 0000000..328cd0f --- /dev/null +++ b/testData/2025-02-04-16-50requestsAndThroughput.csv @@ -0,0 +1,103 @@ +Running 15s test @ http://test.fluffyb.net/1kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 341.69ms 166.00ms 1.30s 90.06% + Req/Sec 163.40 168.11 484.00 81.67% + 1400 requests in 9.32s, 410.16KB read + Non-2xx or 3xx responses: 1400 +Requests/sec: 150.28 +Transfer/sec: 44.03KB +283678,341687,1298341,165996,286337,287799,444356,1075599,1400,420000 + +Running 15s test @ http://test.fluffyb.net/10kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 0.00us 0.00us 0.00us -nan% + Req/Sec 0.00 0.00 0.00 -nan% + 0 requests in 102.06ms, 0.00B read +Requests/sec: 0.00 +Transfer/sec: 0.00B +-9223372036854775808,0,0,0,0,0,0,0,0,0 + +Running 15s test @ http://test.fluffyb.net/100kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 286.97ms 2.05ms 292.11ms 63.14% + Req/Sec 181.75 94.48 373.00 75.00% + 350 requests in 2.30s, 102.54KB read + Non-2xx or 3xx responses: 350 +Requests/sec: 151.98 +Transfer/sec: 44.52KB +283867,286970,292115,2046,286283,287755,290274,291381,350,105000 + +Running 15s test @ http://test.fluffyb.net/1000kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 0.00us 0.00us 0.00us -nan% + Req/Sec 0.00 0.00 0.00 -nan% + 0 requests in 101.79ms, 0.00B read +Requests/sec: 0.00 +Transfer/sec: 0.00B +-9223372036854775808,0,0,0,0,0,0,0,0,0 + +Running 15s test @ http://test.fluffyb.net/1kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 0.00us 0.00us 0.00us -nan% + Req/Sec 0.00 0.00 0.00 -nan% + 0 requests in 201.74ms, 0.00B read +Requests/sec: 0.00 +Transfer/sec: 0.00B +-9223372036854775808,0,0,0,0,0,0,0,0,0 + +Running 15s test @ http://test.fluffyb.net/10kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 0.00us 0.00us 0.00us -nan% + Req/Sec 0.00 0.00 0.00 -nan% + 0 requests in 101.20ms, 0.00B read +Requests/sec: 0.00 +Transfer/sec: 0.00B +-9223372036854775808,0,0,0,0,0,0,0,0,0 + +Running 15s test @ http://test.fluffyb.net/100kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 0.00us 0.00us 0.00us -nan% + Req/Sec 0.00 0.00 0.00 -nan% + 0 requests in 401.91ms, 0.00B read +Requests/sec: 0.00 +Transfer/sec: 0.00B +-9223372036854775808,0,0,0,0,0,0,0,0,0 + +Running 15s test @ http://test.fluffyb.net/1000kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 292.43ms 1.40ms 294.98ms 58.00% + Req/Sec 50.00 0.00 50.00 100.00% + 50 requests in 500.90ms, 14.65KB read + Non-2xx or 3xx responses: 50 +Requests/sec: 99.82 +Transfer/sec: 29.24KB +290184,292425,294980,1401,292375,293375,294561,294980,50,15000 + +Running 15s test @ https://test.fluffyb.net/1kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 0.00us 0.00us 0.00us -nan% + Req/Sec 0.00 0.00 0.00 -nan% + 0 requests in 203.52ms, 0.00B read +Requests/sec: 0.00 +Transfer/sec: 0.00B +-9223372036854775808,0,0,0,0,0,0,0,0,0 + +Running 15s test @ https://test.fluffyb.net/10kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 0.00us 0.00us 0.00us -nan% + Req/Sec 0.00 0.00 0.00 -nan% + 0 requests in 102.49ms, 0.00B read +Requests/sec: 0.00 +Transfer/sec: 0.00B +-9223372036854775808,0,0,0,0,0,0,0,0,0 + diff --git a/testData/2025-02-04-16-54requestsAndThroughput.csv b/testData/2025-02-04-16-54requestsAndThroughput.csv new file mode 100644 index 0000000..e98f930 --- /dev/null +++ b/testData/2025-02-04-16-54requestsAndThroughput.csv @@ -0,0 +1,28 @@ +Usage: wrk + Options: + -c, --connections Connections to keep open + -d, --duration Duration of test + -t, --threads Number of threads to use + + -s, --script Load Lua script file + -H, --header Add header to request + --latency Print latency statistics + --timeout Socket/request timeout + -v, --version Print version details + + Numeric arguments may include a SI unit (1k, 1M, 1G) + Time arguments may include a time unit (2s, 2m, 2h) +Usage: wrk + Options: + -c, --connections Connections to keep open + -d, --duration Duration of test + -t, --threads Number of threads to use + + -s, --script Load Lua script file + -H, --header Add header to request + --latency Print latency statistics + --timeout Socket/request timeout + -v, --version Print version details + + Numeric arguments may include a SI unit (1k, 1M, 1G) + Time arguments may include a time unit (2s, 2m, 2h) diff --git a/testData/2025-02-04-16-56requestsAndThroughput.csv b/testData/2025-02-04-16-56requestsAndThroughput.csv new file mode 100644 index 0000000..ee786f1 --- /dev/null +++ b/testData/2025-02-04-16-56requestsAndThroughput.csv @@ -0,0 +1,35 @@ +Running 1m test @ http://test.fluffyb.net/1kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 339.94ms 197.62ms 1.34s 92.60% + Req/Sec 178.48 169.05 470.00 73.27% + 1962 requests in 12.71s, 574.80KB read + Non-2xx or 3xx responses: 1962 +Requests/sec: 154.38 +Transfer/sec: 45.23KB +------------------------------ +R: 283470,339944,1342411,197617,286283,286949,300162,1321477,1962,588600 + +Running 1m test @ http://test.fluffyb.net/10kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 287.59ms 1.73ms 290.77ms 66.00% + Req/Sec 163.25 77.81 272.00 75.00% + 150 requests in 1.10s, 43.95KB read + Non-2xx or 3xx responses: 150 +Requests/sec: 135.92 +Transfer/sec: 39.82KB +------------------------------ +R: 284133,287593,290771,1728,287894,288632,289959,290722,150,45000 + +Running 1m test @ http://test.fluffyb.net/100kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 0.00us 0.00us 0.00us -nan% + Req/Sec 0.00 0.00 0.00 -nan% + 0 requests in 101.89ms, 0.00B read +Requests/sec: 0.00 +Transfer/sec: 0.00B +------------------------------ +R: -9223372036854775808,0,0,0,0,0,0,0,0,0 + diff --git a/testData/2025-02-04-16-58requestsAndThroughput.csv b/testData/2025-02-04-16-58requestsAndThroughput.csv new file mode 100644 index 0000000..bee0df9 --- /dev/null +++ b/testData/2025-02-04-16-58requestsAndThroughput.csv @@ -0,0 +1,192 @@ +Running 10s test @ http://test.fluffyb.net/1kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 343.04ms 178.43ms 1.31s 92.77% + Req/Sec 161.43 152.28 494.00 77.55% + 1486 requests in 10.01s, 435.35KB read + Non-2xx or 3xx responses: 1486 +Requests/sec: 148.43 +Transfer/sec: 43.49KB +------------------------------ +R: 283833,343043,1314081,178430,286237,287393,436292,1132775,1486,445800 + +Running 10s test @ http://test.fluffyb.net/10kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 303.25ms 112.40ms 1.30s 97.63% + Req/Sec 174.02 129.75 470.00 57.58% + 1649 requests in 10.01s, 483.11KB read + Non-2xx or 3xx responses: 1649 +Requests/sec: 164.67 +Transfer/sec: 48.24KB +------------------------------ +R: 283806,303250,1299714,112395,285994,286599,288882,986365,1649,494700 + +Running 10s test @ http://test.fluffyb.net/100kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 286.62ms 1.61ms 294.27ms 73.29% + Req/Sec 186.03 92.79 490.00 84.21% + 1700 requests in 10.01s, 498.05KB read + Non-2xx or 3xx responses: 1700 +Requests/sec: 169.78 +Transfer/sec: 49.74KB +------------------------------ +R: 284114,286616,294268,1607,286184,287179,289092,291607,1700,510000 + +Running 10s test @ http://test.fluffyb.net/1000kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 365.01ms 248.56ms 1.72s 90.78% + Req/Sec 174.16 147.44 484.00 56.86% + 1489 requests in 10.01s, 436.23KB read + Non-2xx or 3xx responses: 1489 +Requests/sec: 148.73 +Transfer/sec: 43.57KB +------------------------------ +R: 283566,365008,1721277,248557,286380,287664,412910,1447652,1489,446700 + +Running 10s test @ http://test.fluffyb.net/1kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 290.71ms 56.94ms 1.31s 99.06% + Req/Sec 86.14 69.35 242.00 53.85% + 1685 requests in 10.01s, 493.65KB read + Non-2xx or 3xx responses: 1685 +Requests/sec: 168.25 +Transfer/sec: 49.29KB +------------------------------ +R: 283609,290712,1307570,56941,285892,286320,287696,293310,1685,505500 + +Running 10s test @ http://test.fluffyb.net/10kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 287.94ms 19.89ms 651.61ms 99.41% + Req/Sec 88.19 45.60 240.00 77.65% + 1694 requests in 10.01s, 496.29KB read + Non-2xx or 3xx responses: 1694 +Requests/sec: 169.16 +Transfer/sec: 49.56KB +------------------------------ +R: 283683,287942,651606,19885,286287,287021,288934,292329,1694,508200 + +Running 10s test @ http://test.fluffyb.net/100kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 371.72ms 264.66ms 1.51s 90.88% + Req/Sec 90.09 65.56 232.00 59.09% + 1496 requests in 10.02s, 438.28KB read + Non-2xx or 3xx responses: 1496 +Requests/sec: 149.35 +Transfer/sec: 43.76KB +------------------------------ +R: 283608,371717,1509849,264664,286233,287814,470794,1506441,1496,448800 + +Running 10s test @ http://test.fluffyb.net/1000kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 288.99ms 6.22ms 321.17ms 89.71% + Req/Sec 95.24 52.06 240.00 68.82% + 1700 requests in 10.02s, 498.05KB read + Non-2xx or 3xx responses: 1700 +Requests/sec: 169.67 +Transfer/sec: 49.71KB +------------------------------ +R: 284311,288989,321169,6217,286642,288089,295465,318833,1700,510000 + +Running 10s test @ https://test.fluffyb.net/1kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 352.24ms 220.18ms 1.33s 90.74% + Req/Sec 202.07 179.34 494.00 51.16% + 1500 requests in 10.07s, 439.45KB read + Non-2xx or 3xx responses: 1500 +Requests/sec: 148.92 +Transfer/sec: 43.63KB +------------------------------ +R: 284077,352236,1333640,220179,286639,287570,292481,1332670,1500,450000 + +Running 10s test @ https://test.fluffyb.net/10kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 286.51ms 2.42ms 306.37ms 93.09% + Req/Sec 186.82 119.50 470.00 67.35% + 1650 requests in 10.02s, 483.40KB read + Non-2xx or 3xx responses: 1650 +Requests/sec: 164.67 +Transfer/sec: 48.24KB +------------------------------ +R: 283682,286511,306374,2423,286004,286601,288002,300889,1650,495000 + +Running 10s test @ https://test.fluffyb.net/100kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 286.32ms 9.03ms 648.86ms 99.88% + Req/Sec 155.18 113.80 390.00 58.06% + 1676 requests in 10.02s, 491.02KB read + Non-2xx or 3xx responses: 1676 +Requests/sec: 167.28 +Transfer/sec: 49.01KB +------------------------------ +R: 283645,286323,648859,9026,286001,286453,287392,288984,1676,502800 + +Running 10s test @ https://test.fluffyb.net/1000kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 359.94ms 237.34ms 1.42s 90.90% + Req/Sec 201.64 166.31 484.00 53.19% + 1500 requests in 10.02s, 439.45KB read + Non-2xx or 3xx responses: 1500 +Requests/sec: 149.67 +Transfer/sec: 43.85KB +------------------------------ +R: 283932,359937,1416215,237336,286058,286877,398212,1399309,1500,450000 + +Running 10s test @ https://test.fluffyb.net/1kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 290.14ms 55.61ms 1.31s 99.28% + Req/Sec 99.84 80.26 242.00 55.96% + 1647 requests in 10.03s, 482.52KB read + Non-2xx or 3xx responses: 1647 +Requests/sec: 164.27 +Transfer/sec: 48.12KB +------------------------------ +R: 283612,290136,1309360,55609,285917,286431,287427,299618,1647,494100 + +Running 10s test @ https://test.fluffyb.net/10kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 286.04ms 1.11ms 292.79ms 78.69% + Req/Sec 92.79 54.01 222.00 71.29% + 1675 requests in 10.03s, 490.72KB read + Non-2xx or 3xx responses: 1675 +Requests/sec: 166.98 +Transfer/sec: 48.92KB +------------------------------ +R: 283468,286044,292786,1105,285877,286243,287168,291050,1675,502500 + +Running 10s test @ https://test.fluffyb.net/100kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 382.55ms 290.09ms 1.62s 90.41% + Req/Sec 95.20 88.33 242.00 69.34% + 1444 requests in 10.03s, 423.05KB read + Non-2xx or 3xx responses: 1444 +Requests/sec: 143.90 +Transfer/sec: 42.16KB +------------------------------ +R: 283896,382548,1624675,290091,286040,286769,548495,1592458,1444,433200 + +Running 10s test @ https://test.fluffyb.net/1000kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 287.81ms 32.77ms 1.29s 99.75% + Req/Sec 89.30 77.16 232.00 58.41% + 1596 requests in 10.04s, 467.58KB read + Non-2xx or 3xx responses: 1596 +Requests/sec: 159.04 +Transfer/sec: 46.59KB +------------------------------ +R: 283800,287813,1289098,32768,286136,286750,287636,290783,1596,478800 + diff --git a/testData/2025-02-04-16-58sslTest.csv b/testData/2025-02-04-16-58sslTest.csv new file mode 100644 index 0000000..97e35c5 --- /dev/null +++ b/testData/2025-02-04-16-58sslTest.csv @@ -0,0 +1,48 @@ +Running 10s test @ http://test.fluffyb.net/0kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 288.64ms 26.64ms 741.33ms 99.65% + Req/Sec 135.06 120.36 490.00 81.82% + 1146 requests in 10.01s, 330.15KB read + Non-2xx or 3xx responses: 1146 +Requests/sec: 114.48 +Transfer/sec: 32.98KB +------------------------------ +R: 283621,288639,741326,26636,286518,287739,289868,294913,1146,338070 + +Running 10s test @ http://test.fluffyb.net/0kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 371.55ms 271.83ms 1.43s 90.48% + Req/Sec 65.18 46.98 240.00 82.22% + 1000 requests in 10.01s, 288.09KB read + Non-2xx or 3xx responses: 1000 +Requests/sec: 99.89 +Transfer/sec: 28.78KB +------------------------------ +R: 283764,371552,1433677,271828,286372,287720,296165,1427712,1000,295000 + +Running 10s test @ https://test.fluffyb.net/0kb.file + 1 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 286.49ms 6.50ms 466.73ms 98.00% + Req/Sec 102.79 130.02 465.00 84.21% + 850 requests in 10.02s, 244.87KB read + Non-2xx or 3xx responses: 850 +Requests/sec: 84.85 +Transfer/sec: 24.45KB +------------------------------ +R: 283781,286485,466731,6499,285733,286354,288419,294016,850,250750 + +Running 10s test @ https://test.fluffyb.net/0kb.file + 2 threads and 50 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 285.87ms 1.45ms 295.16ms 88.35% + Req/Sec 76.72 71.67 242.00 71.70% + 850 requests in 10.02s, 244.87KB read + Non-2xx or 3xx responses: 850 +Requests/sec: 84.80 +Transfer/sec: 24.43KB +------------------------------ +R: 283522,285868,295156,1451,285620,286084,287071,293683,850,250750 +