Skip to content

Instantly share code, notes, and snippets.

@AllanCapistrano
Created July 16, 2025 18:42
Show Gist options
  • Save AllanCapistrano/6cb6b791aeb4d1b03631f91b4013685e to your computer and use it in GitHub Desktop.
Save AllanCapistrano/6cb6b791aeb4d1b03631f91b4013685e to your computer and use it in GitHub Desktop.
Performs multiple requests in parallel.
#!/bin/bash
URL=""
TOTAL=10 # Amount of request
PARALELAS=10 # Number of simultaneous requests allowed
seq 1 $TOTAL | xargs -P $PARALELAS -I {} bash -c '
echo "🔁 Request {}:"
RESPONSE=$(curl -s -w "\n[status_code:%{http_code}]\n" "'"$URL"'")
echo "$RESPONSE"
echo "--------------------------"
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment