Web development, it is the stress test, it is to assess whether a product is eligible to go live on the basic standards, let us analyze how they use.
Before the test, the number of ports in front of the system is changed to large, look at the default limits of the Mac
ulimit -aopen files (-n) 2560
More than 2000 FD number is very small, we change him, of course, I tested, can only open 10000, Linux can open more than 6W, so:
ulimit -n 10000
Check it with the ulimit-a.
open files (-n) 10000
Next we turn on the CPU check, usually we only see the one with the highest utilization:
top -n1
-n3 is the first 3, and so on.
OK, we can go on ...
Webbench
Webbench is a powerful stress testing tool that can simulate up to 30,000 concurrent connections to test the load capacity of the website, and the personal feel is better than the AB pressure test tool that comes with Apache and is particularly handy for installation and use.
Installation:
install webbench
Usage:
webbench -c 并发数 -t 运行测试时间 URL
Such as:
webbench -c 5000 -t 120 http://www.epooll.com
Ab
AB is Apache's own stress test tool, very small, unfortunately poor performance under the Mac, beating too much, and there will be apr_socket_recv:connection reset by peer (54) error. AB Want to say love you not easy Ah, but Linux is still relatively stable, so still say use it.
Installation:
http://apache.mirrors.pair.com/httpd/
Usage:
ab -c 并发数 -n 请求数 URL
Such as:
ab -c 1000 -n 10000 http://www.epooll.com
Of course, the other usage is your own man AB and read the documentation.
Siege
Siege is a good tool that I solved ab fucking apr_socket_recv:connection reset by peer (54) error, and had to say that the tool is really good, usage and webbench, but the information is much more comprehensive.
Installation:
install siege
Usage:
siege -c 并发数 -t 运行测试时间 URL
Such as:
siege -c 1000 -t 5s URL
Here to pay attention to IS-T after the time to take units, s for seconds, if not, is the minutes, minutes of units, or very long, so pay attention.
Use Web server performance/Stress testing tools under Mac Webbench, AB, siege