Created
January 29, 2019 10:25
-
-
Save eXtrem0us/dce9cd994473930abb87cdc6c567199f to your computer and use it in GitHub Desktop.
stress test using phantomjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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