Skip to content

Instantly share code, notes, and snippets.

@Smithx10
Created February 7, 2020 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Smithx10/d2f8595f401d3188a8573d197181831a to your computer and use it in GitHub Desktop.
Save Smithx10/d2f8595f401d3188a8573d197181831a to your computer and use it in GitHub Desktop.
#two instances must be on the same CN
# start ubuntu 18.04 bhve vm
wget https://github.com/m3ng9i/ran/releases/download/v0.1.4/ran_linux_amd64.zip
sudo apt-get install unzip
unzip ran_linux_amd64.zip
fallocate -l 1G 1G
# start http server in bhyve
ubuntu@6dfb4cea-dd08-49d8-811e-4de35157555b:~/jeff$ ./ran_linux_amd64 -l
2020-02-07 21:50:27.276874 INFO: System: Ran is running on HTTP port 8080
2020-02-07 21:50:27.277317 INFO: System: Listening on http://127.0.0.1:8080
2020-02-07 21:50:27.277325 INFO: System: Listening on http://10.91.193.32:8080
# start a smartos zone
[root@pgbouncer-prod-00 /jeff]# cat jeff.sh
#!/bin/bash
date
for i in {1..5};do
curl -sL http://10.91.193.32:8080/1G > /dev/null &
done
wait
date
./jeff.sh
Watch the fireworks.
@danmcd
Copy link

danmcd commented Feb 7, 2020

My version:

#!/bin/bash
date
NUM=${1:-10}
echo "Spawning $NUM"
while [[ $NUM > 0 ]];do
  curl -s --retry 0 http://centos.work.kebe.com/vmdump.0 > /dev/null &
  curlpid=$! 
  NUM=$((NUM - 1))
  echo "Launched curl pid=$curlpid, $NUM left"
done
wait
date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment