Last active
May 24, 2017 14:15
-
-
Save mrsiano/1afa8f1a26e69d9ffa53598d7ec92015 to your computer and use it in GitHub Desktop.
psql-simulatnusly-hits.sh
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 | |
# the following script simply testing an SQL for simulatnusly execution. | |
# usage: ./psql-simulatnusly-hits.sh test "SELECT EXTRACT(DECADE FROM TIMESTAMP '2017-05-01 20:00:00');" | |
db=$1 | |
sql=$2 | |
parallel=$3 | |
# TODO: add statistics. | |
for p in `seq 1 $parallel`; do | |
nohup psql -U $db -c "$sql" > /dev/null 2>&1 & echo ""; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment