Tcpcopy,an online request replication tool fit for nginx
wangbin579
nginx-forum at nginx.us
Thu Nov 3 03:03:02 UTC 2011
An example:
Suppose 13 and 14 are online machines, 148 is a target machine which
is similar to
the online machines, and 12321 is used both as local port and remote
port. We
use tcpcopy to test if 148 can endure two times of current online
stress.
Using tcpcopy to perform the above test task.
the target machine(148)
# modprobe ip_queue (if not run up)
# iptables -I OUTPUT -p tcp --sport 12321 -j QUEUE (if not set)
# ./interception
online machine(13):
# ./tcpcopy xx.xx.xx.13 12321 xx.xx.xx.148 12321
online machine(14):
# ./tcpcopy xx.xx.xx.14 12321 xx.xx.xx.148 12321
Cpu load and memory usage are as follows:
13 cpu:
11124 adrun 15 0 193m 146m 744 S 18.6 7.3 495:31.56
asyn_server
11281 root 15 0 65144 40m 1076 S 12.3 2.0 0:47.89 tcpcopy
14 cpu:
16855 adrun 15 0 98.7m 55m 744 S 21.6 2.7 487:49.51
asyn_server
16429 root 15 0 41156 17m 1076 S 14.0 0.9 0:33.63 tcpcopy
148 cpu :
25609 root 15 0 76892 59m 764 S 49.6 2.9 63:03.14
asyn_server
20184 root 15 0 5624 4232 292 S 17.0 0.2 0:52.82
interception
Access log analysis:
13 online machine: grep 'Tue 11:08' access_0913_11.log |wc -l
:89316, 1489 reqs/sec
14 online machine: grep 'Tue 11:08' access_0913_11.log |wc -l
:89309, 1488 reqs/sec
148 test machine: grep 'Tue 11:08' access_0913_11.log |wc -l
:178175, 2969 reqs/sec
request loss rate:
(89316+89309-178175)/(89316+89309)=0.25%
From the above, we can see that the target machine can endure two
times of current
online stress.
What about the cpu load ?
tcpcopy on online machine 13 occupies 12.3% of cpu load, tcpcopy on
online 14
occupies 14% and interception on target machine 148 occupies 17%. We
can see
that the cpu load is very low here, and so is the memory usage.
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217680,217734#msg-217734
More information about the nginx
mailing list