Files
cv-site/test_concurrency.sh
T

27 lines
579 B
Bash
Raw Normal View History

#!/bin/bash
echo "=== Thread Safety Test ==="
echo "Starting 20 concurrent clients making 10 requests each..."
start=$(date +%s.%N)
for i in $(seq 1 20); do
{
for j in $(seq 1 10); do
curl -s -o /dev/null 'http://localhost:1999/?lang=en' || true
done
} &
done
wait
end=$(date +%s.%N)
elapsed=$(echo "$end - $start" | bc)
echo ""
echo "All 200 requests completed in ${elapsed}s"
echo "Throughput: $(echo "scale=2; 200 / $elapsed" | bc) req/s"
echo ""
echo "=== Cache Statistics After Concurrent Test ==="
curl -s http://localhost:1999/health | jq '.cache'