$0 <uri> <username> <password>
Optional environment variables:
CLUSTER_ENDPOINT REST endpoint. Defaults to <uri>.
TOKEN Bearer token. Defaults to <username>:<password>.
CLUSTER_ENDPOINT="${CLUSTER_ENDPOINT:-${URI%/}}"
CLUSTER_ENDPOINT="${CLUSTER_ENDPOINT%/}"
TOKEN="${TOKEN:-${USERNAME}:${PASSWORD}}"
command -v vectordbbench >/dev/null || {
echo "vectordbbench not found in PATH" >&2
command -v curl >/dev/null || {
echo "curl not found in PATH" >&2
echo "[$(date '+%F %T')] start alter_properties for VDBBench"
curl --fail-with-body --show-error --silent \
--url "${CLUSTER_ENDPOINT}/v2/vectordb/collections/alter_properties" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
\"collectionName\": \"VDBBench\",
\"knowhere.enable_thp\": true,
\"knowhere.enable_prefetch\": true
echo "[$(date '+%F %T')] alter_properties finished"
vectordbbench milvusdiskann \
--case-type Performance768D10M \
--num-concurrency 1,10,25,50,100,150,200,250,300,350,400 \
--user-name ${USERNAME} \
--password ${PASSWORD} \
--num-shards 1 || BENCH_RC=$?
wait "${ALTER_PID}" || CURL_RC=$?
if [[ "${CURL_RC}" -ne 0 ]]; then
echo "alter_properties failed with exit code ${CURL_RC}" >&2
if [[ "${BENCH_RC}" -ne 0 ]]; then