libretime/easypanel/code/tools/icecast-stress.sh
Cesar Jhoanny Mendivil Rubio 697b7cc288
Some checks are pending
Container / meta (analyzer) (push) Waiting to run
Container / meta (api) (push) Waiting to run
Container / meta (legacy) (push) Waiting to run
Container / meta (nginx) (push) Waiting to run
Container / meta (playout) (push) Waiting to run
Container / meta (worker) (push) Waiting to run
Container / build (push) Blocked by required conditions
Project / pre-commit (push) Waiting to run
Project / test-tools (push) Waiting to run
Release-Please / release-please (push) Waiting to run
feat(easypanel): actualizar configuración y scripts de EasyPanel, incluyendo mejoras en la generación de contraseñas, sincronización de herramientas y gestión de configuraciones
2025-10-01 17:41:20 -07:00

37 lines
686 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
error() {
echo >&2 "error: $*"
exit 1
}
command -v curl > /dev/null || error "curl command not found!"
# Run concurrent curls which download from url to /dev/null.
url="$1"
# max concurrent calls
max=1000
# call duration (in seconds)
duration=100
# number of calls to start in batch
batch=10
# time to wait before starting a new batch of calls (in seconds)
delay=1
count=0
while [[ "$count" -le "$max" ]]; do
echo "starting $batch new calls ($count)"
for ((i = 1; i <= batch; i++)); do
curl -o /dev/null -m "$duration" -s "$url" &
done
count=$((count + batch))
sleep "$delay"
done
echo "waiting for calls to finish"
wait
echo "done"