Test the web page Response Time Using httping

Source: Internet
Author: User

Performance testing is an important engineering project in software testing. Sometimes we need to test the response time of web pages, httping is an open-source software dedicated to testing the response time of web pages.

Install FreeBSD

# Cd/usr/ports/net/httping
# Make install clean
# Rehash

Usage:

# Httping-h

Httping: option requires an argument -- h
HTTPing v1.2.6, (C) 2003-2008 folkert@vanheusden.com
SSL support extended

-G url (e.g.-g http: // localhost /)
-H hostname (e.g. localhost)
-P portnr portnumber (e.g. 80)
-X host: port hostname + portnumber of proxyserver
-C count how many times to connect
-I interval delay between each connect
-T timeout (default: 30 s)
-S show statuscodes
-S split time in connect-time and processing time
-G do a GET request instead of HEAD (read
Contents of the page as well)
-B show transfer speed in KB/s (use with-G)
-B like-B but use compression if available
-L x limit the amount of data transferred (for-B)
To 'X' (in bytes)
-X show the number of KB transferred (for-B)
-L connect using SSL
-Z show fingerprint (SSL)
-F flood connect (no delays)
-A audible ping
-M give machine parseable output (see
Also-o and-e)
-O rc, rc,... what http results codes indicate 'OK'
Coma seperated WITHOUT spaces inbetween
Default is 200, use with-e
-E str string to display when http result code
Doesn' t match
-I str use 'str' for the UserAgent header
-R str use 'str' for the Referer header
-R resolve hostname only once (usefull when
Pinging roundrobin DNS: also takes the first
DNS lookup out of the loop so that the first
Measurement is also correct)
-N warn, crit Nagios-mode: return 1 when avg. response time
> = Warn, 2 if> = crit, otherwhise return 0
-N x Nagios mode 2: return 0 when all fine, 'X'
When anything failes
-Y ip [: port] bind to ip-address (and thus interface) [/port]
-Q quiet, only returncode
-V show the version


Every option has annotations, which are easy to understand.

Next we will use it to test the response time from the local sina page.
The network latency may cause unstable results.
Average Value for 10 tests

# Httping-c10-g http://www.sina.com.cn

PING www.sina.com.cn: 80 (http://www.sina.com.cn ):
Connected to www.sina.com.cn: 80, seq = 0 time = 8.76 MS
Connected to www.sina.com.cn: 80, seq = 1 time = 4.81 MS
Connected to www.sina.com.cn: 80, seq = 2 time = 5005.72 MS
Connected to www.sina.com.cn: 80, seq = 3 time = 6204.22 MS
Connected to www.sina.com.cn: 80, seq = 4 time = 5.45 MS
Connected to www.sina.com.cn: 80, seq = 5 time = 5.63 MS
Connected to www.sina.com.cn: 80, seq = 6 time = 7.44 MS
Connected to www.sina.com.cn: 80, seq = 7 time = 5006.06 MS
Connected to www.sina.com.cn: 80, seq = 8 time = 5.16 MS
Connected to www.sina.com.cn: 80, seq = 9 time = 5.01 MS
--- Http://www.sina.com.cn ping statistics ---
10 connects, 10 OK, 0.00% failed
Round-trip min/avg/max = 4.8/1625.8/6204.2 MS

The average value is 1625.8 ms, that is, 1.63 s.

If you are testing a host in this segment, the test results will be more trustworthy.


# Httping-c10-g http://www.bkjia.com

PING www.bkjia.com: 80 (http://www.bkjia.com ):
Connected to www.bkjia.com: 80, seq = 0 time = 17.11 MS
Connected to www.bkjia.com: 80, seq = 1 time = 23.52 MS
Connected to www.bkjia.com: 80, seq = 2 time = 18.72 MS
Connected to www.bkjia.com: 80, seq = 3 time = 19.37 MS
Connected to www.bkjia.com: 80, seq = 4 time = 107.02 MS
Connected to www.bkjia.com: 80, seq = 5 time = 19.70 MS
Connected to www.bkjia.com: 80, seq = 6 time = 31.35 MS
Connected to www.bkjia.com: 80, seq = 7 time = 21.85 MS
Connected to www.bkjia.com: 80, seq = 8 time = 19.67 MS
Connected to www.bkjia.com: 80, seq = 9 time = 19.52 MS
--- Http://www.bkjia.com ping statistics ---
10 connects, 10 OK, 0.00% failed
Round-trip min/avg/max = 17.1/29.8/107.0 MS

The test result is displayed.
Minimum web page Response Time: 17.1 MS
Average web page Response Time: 29.8 MS
Max web page Response Time: 107.0 MS

Generally, the data that makes sense to us is the average value.

You can use shell to directly obtain this value.

# Httping-c5-g http://www.bkjia.com | tail-n1 | awk '{print $4}' | cut-d/-f2

You can also use shell and rrdtool to draw a perfect web response time diagram, which is not bad, ^_^^_ ^

Httping details: click here
Httping: click here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.