Skip to content

Instantly share code, notes, and snippets.

@eXtrem0us
Created January 29, 2019 10:25
Show Gist options
  • Save eXtrem0us/dce9cd994473930abb87cdc6c567199f to your computer and use it in GitHub Desktop.
Save eXtrem0us/dce9cd994473930abb87cdc6c567199f to your computer and use it in GitHub Desktop.
stress test using phantomjs
#!/bin/bash
Requests=$1
Concurrency=$2
URL=$3
CheckInterval=0
for r in $(seq $Requests)
do
while [ $(pgrep -c phantomjs) -ge $Concurrency ]
do
sleep $CheckInterval
done
phantomjs rasterize.js $URL /dev/null &
done
#for leftover phantomjs processes in memory
while [ $(pgrep -c phantomjs) -gt 0 ]
do
sleep $CheckInterval
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment