-
Notifications
You must be signed in to change notification settings - Fork 0
/
transfer-test.sh
78 lines (55 loc) · 2.21 KB
/
transfer-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# vars
TARGET_DIR=~
ACCESS=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_ENDPOINT=
PARALLEL=24
TESTBUCKET=
# install tools
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
apt-get install -y zip bmon awscli curl speedtest
curl -L https://github.com/storj/storj/releases/latest/download/uplink_linux_amd64.zip -o uplink_linux_amd64.zip
unzip -o uplink_linux_amd64.zip
sudo install uplink /usr/local/bin/uplink
# config tools
aws configure set default.s3.multipart_threshold 60MB
aws configure set default.s3.multipart_chunksize 60MB
aws configure set default.s3.max_concurrent_requests $PARALLEL
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
uplink access import default $ACCESS
# make test data
dd if=/dev/urandom of=testfile10G.bin iflag=fullblock bs=1G count=10
dd if=/dev/urandom of=testfile50G.bin iflag=fullblock bs=1G count=50
dd if=/dev/urandom of=testfile100G.bin iflag=fullblock bs=1G count=100
# take baseline
speedtest --accept-gdpr --accept-license
### run tests
## aws
# upload
time aws s3 cp testfile10G.bin s3://$TESTBUCKET --endpoint-url=$AWS_ENDPOINT
time aws s3 cp testfile50G.bin s3://$TESTBUCKET --endpoint-url=$AWS_ENDPOINT
time aws s3 cp testfile100G.bin s3://$TESTBUCKET --endpoint-url=$AWS_ENDPOINT
## cleanup data
rm -f testfile10G.bin
rm -f testfile50G.bin
rm -f testfile100G.bin
# download
time aws s3 cp s3://$TESTBUCKET/testfile10G.bin $TARGET_DIR --endpoint-url=$AWS_ENDPOINT
time aws s3 cp s3://$TESTBUCKET/testfile50G.bin $TARGET_DIR --endpoint-url=$AWS_ENDPOINT
time aws s3 cp s3://$TESTBUCKET/testfile100G.bin $TARGET_DIR --endpoint-url=$AWS_ENDPOINT
## uplink
# upload
time uplink cp testfile10G.bin sj://$TESTBUCKET -p $PARALLEL
time uplink cp testfile50G.bin sj://$TESTBUCKET -p $PARALLEL
time uplink cp testfile100G.bin sj://$TESTBUCKET -p $PARALLEL
## cleanup data
rm -f testfile10G.bin
rm -f testfile50G.bin
rm -f testfile100G.bin
# download
time uplink cp sj://$TESTBUCKET/testfile10G.bin $TARGET_DIR -p $PARALLEL
time uplink cp sj://$TESTBUCKET/testfile50G.bin $TARGET_DIR -p $PARALLEL
time uplink cp sj://$TESTBUCKET/testfile100G.bin $TARGET_DIR -p $PARALLEL