4 # By default, this script runs against `http://127.0.0.1:8536`, but you can pass a different Lemmy instance,
5 # eg `./api_benchmark.sh "https://example.com"`.
6 DOMAIN=${1:-"http://127.0.0.1:8536"}
12 "/api/v1/search?q=test&type_=Posts&sort=Hot"
14 "/api/v1/community/list?sort=Hot"
15 "/api/v1/post/list?sort=Hot&type_=All"
18 ## now loop through the above array
19 for path in "${arr[@]}"
24 curl --show-error --fail --silent "$URL" >/dev/null
25 ab -c 64 -t 10 "$URL" > out.abtest
26 grep "Server Hostname:" out.abtest
27 grep "Document Path:" out.abtest
28 grep "Requests per second" out.abtest
29 grep "(mean, across all concurrent requests)" out.abtest
30 grep "Transfer rate:" out.abtest