forked from kgiusti/oslo-messaging-clients
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
94 lines (74 loc) · 2.68 KB
/
setup
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
cat > /etc/yum.repos.d/epel6.repo << EOF
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=\$basearch
failovermethod=priority
enabled=1
gpgcheck=0
EOF
yum install python-pip /usr/include/yaml.h git
pip install oslo.messaging
pip install kombu
git clone https://github.com/fabbione/oslo-messaging-clients.git
cd oslo-messaging-clients
Example:
# start qpid server on one terminal:
./my-server.py test --quiet --config qpid_heartbeat 2 --url qpid://vip-qpid:5672
# fire up qpid client on another terminal
export messages=1000
for i in 0 1 2 4 8 16 32 64 128; do
./my-client.py my-topic --payload=${i}k_payload --quiet --url qpid://vip-qpid:5672 --repeat=$messages methodA arg1 arg2
done
# start rabbitmq server on one termina:
./my-server.py test --quiet --url rabbit://vip-rabbitmq:5672
# fire up rabbitmq client on another terminal
export messages=1000
for i in 0 1 2 4 8 16 32 64 128; do
./my-client.py my-topic --payload=${i}k_payload --quiet --url rabbit://vip-rabbitmq:5672 --repeat=$messages methodA arg1 arg2
done
# qpid testing
qpid-perftest .. use different payload size for 1000 packets, both LB and non-LB, clustered and non clustered
# generate average transaction from qpid-perftest output
#!/bin/bash
cat sum | grep "Total 1000000" | { while read line; do
payload=$(echo $line | awk '{print $5}')
timer=$(echo $line | awk '{print $8}')
average=$(echo "scale=4; (1000000 / $timer) / 2" | bc)
echo $line
echo Average transactions: $average
done;
}
# rabbit testing
yum install mercurial junit ant-junit
hg clone http://hg.rabbitmq.com/rabbitmq-codegen/
hg clone http://hg.rabbitmq.com/rabbitmq-java-client/
cd rabbitmq-java-client/
ant dist
cd build/dist
chmod 755 *.sh
for i in 0 1 2 4 8 16 32 64 128; do
size=$(expr $i \* 1024)
echo "Payload: $size"
./runjava.sh com.rabbitmq.examples.PerfTest -h amqp://vip-rabbitmq:5672 -b 2 -i 20 -z 10 -s $size
done
# use this script to generate totals from javarun.
#!/bin/bash
cat sum |grep -v starting | { while read line; do
mode=$(echo $line | awk '{print $1}')
echo $line
case $mode in
Payload:)
;;
sending)
send=$(echo $line | awk '{print $4}')
;;
recving)
recv=$(echo $line | awk '{print $4}')
total=$(echo "scale=4; ($recv + $send) / 2" | bc)
echo "Total: $total"
;;
esac
done;
}
# rabbitmq/qpid setups are documented here:
https://github.com/fabbione/rhos-ha-deploy/tree/master/rhos4/mrgcloud-setup