# Number of simultaneous requests | |
concurrent_requests=5 | |
# URL and data to send | |
url="http://localhost:8000/predict" | |
data='{ | |
"video_url": "https://pub-3cd645413dfa46b6b49c5bba03e0d881.r2.dev/dum.mp4", | |
"query_type": "video", | |
"query_id": "e6a9d7c1-0e5d-4214-9370-9aadb6610fd5" | |
}' | |
# Use xargs to run multiple curl commands in parallel | |
seq $concurrent_requests | xargs -I{} -P $concurrent_requests curl --location "$url" \ | |
--header 'Content-Type: application/json' \ | |
--data "$data" | |