System version: centos6.3
Apache version: apache2.42 (compile-install)
1. Configure the Limit module
#wget http://dominia.org/djao/limit/mod_limitipconn-0.24.tar.bz2
Installation:
#tar JXVF mod_limitipconn-0.24.tar.bz2
#cd mod_limitipconn-0.24
#vi Makefile
Find Apxs, change it.
Apxs=/usr/local/apache2/bin/apxs
#make && make Install
Examples of global variables:
< Ifmodule mod_limitipconn.c >
< Location/> # All Virtual Host/directory
Maxconnperip 3 # Only 3 concurrent connections per IP allowed
Noiplimit image/* # Don't make IP restrictions on pictures
</location >
< Location/mp3 > #/mp3 directory for all hosts
Maxconnperip 1 # Only one connection request per IP allowed
Onlyiplimit audio/mpeg Video # This limit is only for videos and audio format files
</location >
</ifmodule >
# vi/usr/local/apache2/conf/httpd.conf
--------------------
Extendedstatus on
LoadModule Limitipconn_module modules/mod_limitipconn.so
<ifmodule mod_limitipconn.c>
<location/>
Maxconnperip 6
Noiplimit image/*
</Location>
</IfModule>
-------------------
2, the configuration Webbench the website to carry on the pressure test:
#wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
#tar ZXVF webbench-1.5.tar.gz
#cd webbench-1.5
#make && make Install
3. Use:
Webbench-c 500-t HTTP://127.0.0.1/
Parameter Description:-C Indicates the number of concurrent,-T represents time (seconds)
4. Sample test results:
Webbench-simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking:get HTTP://127.0.0.1/
Clients, running Sec.
speed=3230 pages/min, 11614212 bytes/sec.
requests:1615 susceed, 0 failed.
This article comes from "All the Way North" blog, please be sure to keep this source http://showerlee.blog.51cto.com/2047005/1165374
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/web/