lost and found ( for me ? )

httperf : HTTP/HTTPS traffic generator



# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Linux Mint 12 Lisa"

# uname -ri
3.0.0-24-generic x86_64


[ install ]
# apt-get install -y httperf

# apt-cache policy httperf
httperf:
 Installed: 0.9.0-2build1
 Candidate: 0.9.0-2build1
 Version table:
*** 0.9.0-2build1 0
       500 http://archive.ubuntu.com/ubuntu/ oneiric/universe amd64 Packages
       100 /var/lib/dpkg/status
    0.9.0-2 0
       500 http://gb.archive.ubuntu.com/ubuntu/ natty/universe amd64 Packages


[ sample usage ]

- generate HTTPS traffic
# httperf --hog --ssl --server 192.168.10.35 --rate 100 --uri /index.ht
ml  --ssl-no-reuse --num-call 10 --timeout 3 --num-conn 10000
httperf --hog --timeout=3 --client=0/1 --server=192.168.10.35 --port=443 --uri=/index.html --rate=100 --send-buffer=4096 --recv-buffer=16384 --ssl --ssl-no-reuse --num-conns=10000 --num-calls=10
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE


--rate : # of connections per second
--num-conn : total # of connections.
httperf will quit if cumulative number of connections reaches –num-conn value.

--num-call : # of requests per connection

In this case , Transaction / sec is rate * num-call , i.e. 100 * 10 = 1,000 TPS

Let’s generate HTTPS traffic.
nnnn , fail..
# httperf --hog --ssl --server 192.168.10.35 --rate 100 --uri /index.ht
ml  --ssl-no-reuse --num-call 10 --timeout 3 --num-conn 10000
httperf --hog --timeout=3 --client=0/1 --server=192.168.10.35 --port=443 --uri=/index.html --rate=100 --send-buffer=4096 --recv-buffer=16384 --ssl --ssl-no-reuse --num-conns=10000 --num-calls=10
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
httperf: failed to connect to SSL server (err=-1, reason=5)

# echo $?
255


There’s an warning message when running httperf on the httperf machie.
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE


increase “open files” on httperf machine.
# ulimit –n
100000


and also thre are a lot of error messages on Web server as well.
nf_conntrack: table full, dropping packet.
nf_conntrack: table full, dropping packet.
nf_conntrack: table full, dropping packet.
nf_conntrack: table full, dropping packet.


this is caused by iptables.
current # is ..
# sysctl net.netfilter.nf_conntrack_max
net.netfilter.nf_conntrack_max = 31884


increase that number on the Web server..
# sysctl -w net.netfilter.nf_conntrack_max="100000"
net.netfilter.nf_conntrack_max = 100000

# sysctl net.netfilter.nf_conntrack_max
net.netfilter.nf_conntrack_max = 100000


try again.
# httperf --hog --ssl --server 192.168.10.35 --rate 100 --uri /index.ht
ml  --ssl-no-reuse --num-call 10 --timeout 3 --num-conn 10000
httperf --hog --timeout=3 --client=0/1 --server=192.168.10.35 --port=443 --uri=/index.html --rate=100 --send-buffer=4096 --recv-buffer=16384 --ssl --ssl-no-reuse --num-conns=10000 --num-calls=10
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1

Total: connections 10000 requests 100000 replies 100000 test-duration 100.012 s

Connection rate: 100.0 conn/s (10.0 ms/conn, <=124 concurrent connections)
Connection time [ms]: min 15.0 avg 56.3 max 1235.6 median 28.5 stddev 141.8
Connection time [ms]: connect 11.6
Connection length [replies/conn]: 10.000

Request rate: 999.9 req/s (1.0 ms/req)
Request size [B]: 76.0

Reply rate [replies/s]: min 998.7 avg 999.9 max 1000.5 stddev 0.4 (20 samples)
Reply time [ms]: response 4.5 transfer 0.0
Reply size [B]: header 417.0 content 10.0 footer 0.0 (total 427.0)
Reply status: 1xx=0 2xx=100000 3xx=0 4xx=0 5xx=0

CPU time [s]: user 19.09 system 80.93 (user 19.1% system 80.9% total 100.0%)
Net I/O: 491.2 KB/s (4.0*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0


- generate HTTP traffic

# httperf --hog --server 192.168.10.35 --rate 300 --uri /index.html  --
num-call 10 --timeout 3 --num-conn 50000
httperf --hog --timeout=3 --client=0/1 --server=192.168.10.35 --port=80 --uri=/index.html --rate=300 --send-buffer=4096 --recv-buffer=16384 --num-conns=50000 --num-calls=10
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1

Total: connections 50000 requests 490003 replies 490001 test-duration 255.705 s

Connection rate: 195.5 conn/s (5.1 ms/conn, <=946 concurrent connections)
Connection time [ms]: min 10.1 avg 47.2 max 62107.5 median 14.5 stddev 572.7
Connection time [ms]: connect 0.5
Connection length [replies/conn]: 10.000

Request rate: 1916.3 req/s (0.5 ms/req)
Request size [B]: 76.0

Reply rate [replies/s]: min 0.0 avg 2795.0 max 3095.0 stddev 721.7 (35 samples)
Reply time [ms]: response 4.2 transfer 0.0
Reply size [B]: header 417.0 content 10.0 footer 0.0 (total 427.0)
Reply status: 1xx=0 2xx=490001 3xx=0 4xx=0 5xx=0

CPU time [s]: user 38.56 system 217.15 (user 15.1% system 84.9% total 100.0%)
Net I/O: 941.3 KB/s (7.7*10^6 bps)

Errors: total 1002 client-timo 1002 socket-timo 0 connref

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.