Files
asterinas/test/benchmark/nginx/http_req10k_conc20_bw/host.sh
2024-10-28 18:57:41 +08:00

19 lines
391 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: MPL-2.0
set -e
# Function to stop the guest VM
stop_guest() {
echo "Stopping guest VM..."
pgrep qemu | xargs kill
}
# Trap EXIT signal to ensure guest VM is stopped on script exit
trap stop_guest EXIT
# Run apache bench
ab -n 10000 -c 20 http://localhost:8080/index.html
# The trap will automatically stop the guest VM when the script exits