foo_50 is now produces with /dev/random and added a small doc and diff in stress.sh

This commit is contained in:
craff 2023-01-17 21:41:42 -10:00
parent ce463b76b4
commit bac91923ed
6 changed files with 12 additions and 9 deletions

View file

@ -1,5 +1,5 @@
serve directory . on http://127.0.0.1:8088 serve directory . on http://127.0.0.1:8088
0 0 52428800 data21 52428800 data21
0 0 52428800 data22 52428800 data22
0 0 52428800 data23 52428800 data23
0 0 157286400 total 157286400 total

View file

@ -20,4 +20,4 @@ curl -N "http://localhost:${PORT}/foo_50" -o data23 \
-H 'Tranfer-encoding: chunked' --max-time 10 -H 'Tranfer-encoding: chunked' --max-time 10
kill $PID kill $PID
wc data21 data22 data23 wc -c data21 data22 data23

View file

@ -39,7 +39,7 @@
(targets foo_50) (targets foo_50)
(enabled_if (= %{system} "linux")) (enabled_if (= %{system} "linux"))
(action (action
(bash "dd if=/dev/zero of=%{targets} bs=1M count=50"))) (bash "dd if=/dev/random of=%{targets} bs=1M count=50")))
(rule (rule
(targets upload-out) (targets upload-out)

View file

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
# usage: source stress.sh path/http_of_dir.exe nb
# it will run np parallel curl to fetch file $url below
SERVER=$1 SERVER=$1
nb=$2 nb=$2
@ -12,7 +15,7 @@ sleep_time=0
for (( c=1; c<=$nb; c++ )); do for (( c=1; c<=$nb; c++ )); do
f=$(mktemp) f=$(mktemp)
(curl -s $url > $f; stat -c %s $f; rm $f) & (curl -s $url > $f; stat -c %s $f; diff foo_50 $f; rm $f) &
PIDS[$c]=$! PIDS[$c]=$!
sleep $sleep_time sleep $sleep_time

View file

@ -1,2 +1,2 @@
serve directory . on http://127.0.0.1:8087 serve directory . on http://127.0.0.1:8087
upload successful 0 0 52428800 data upload successful52428800 data

View file

@ -14,4 +14,4 @@ cat foo_50 | curl -N -X PUT http://localhost:$PORT/data --data-binary @- \
-H 'Transfer-Encoding: chunked' --max-time 10 -H 'Transfer-Encoding: chunked' --max-time 10
kill $PID kill $PID
wc data wc -c data