Created
January 20, 2010 11:08
-
-
Save reidrac/281767 to your computer and use it in GitHub Desktop.
Testing file descriptor count
This file contains 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/sh | |
if [ $# -ne 3 ]; then | |
echo "$0 URL loops timeout" | |
exit 1; | |
fi | |
PID=`pgrep cherokee-worker` | |
echo "Start: cherokee-worker PID: $PID" | |
BEFORE=`fstat -p $PID | tail -n 1 | awk ' { print $4 }' | sed 's/\*//'` | |
i=$2 | |
while [ $i -gt 0 ]; do | |
wget $1 -q -O /dev/null | |
i=$(($i-1)) | |
sleep $3 | |
echo "** $i loops left" | |
done | |
AFTER=`fstat -p $PID | tail -n 1 | awk ' { print $4 }' | sed 's/\*//'` | |
echo "URL: $1, Loops: $2 -- FD Before: $BEFORE, After: $AFTER, Diff: $(($AFTER-$BEFORE))" | |
exit 0 | |
#EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment