1 2 3 4 5 6 | sudo yum -y install ctags wget http: //gitsea .com /wp-content/uploads/2013/06/webbench-1 .5. tar .gz tar zxvf webbench-1.5. tar .gz cd webbench-1.5 make make install |
1 | webbench -c 1000 -t 10 http: //www .google.com.hk/ |
1 2 3 4 5 6 | sudo yum -y install apr apr-devel tar zxvf tomcat-native. tar .gz // 該文件在tomcat的bin目錄下面 cd tomcat-native-1.1.24-src /jni/native . /configure --with-apr= /usr/bin/apr-1-config make make install |
1 2 | Libraries have been installed in : /usr/local/apr/lib |
1 | CATALINA_OPTS= "-Djava.library.path=/usr/local/apr/lib" |
1 | protocol= "org.apache.coyote.http11.Http11AprProtocol" |
1 2 3 4 | 六月 29, 2013 11:55:35 上午 org.apache.catalina.core.AprLifecycleListener init INFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.3.9. 六月 29, 2013 11:55:35 上午 org.apache.catalina.core.AprLifecycleListener init INFO: APR capabilities: IPv6 [ true ], sendfile [ true ], accept filters [ false ], random [ true ]. |
1 | JAVA_OPTS= "-Xms1024m -Xmx1024m -Xss1024K -XX:PermSize=64m -XX:MaxPermSize=128m" |
1 2 3 4 5 | -Xms JVM初始化堆內(nèi)存大小 -Xmx JVM堆的最大內(nèi)存 -Xss 線程棧大小 -XX:PermSize JVM非堆區(qū)初始內(nèi)存分配大小 -XX:MaxPermSize JVM非堆區(qū)最大內(nèi)存 |
1 | enableLookups= "false" |
1 2 3 4 5 6 7 8 9 | <Connector port= "8080"
protocol= "org.apache.coyote.http11.Http11AprProtocol"
connectionTimeout= "20000" // 鏈接超時時長
redirectPort= "8443"
maxThreads= "500" // 設定處理客戶請求的線程的最大數(shù)目,決定了服務器可以同時響應客戶請求的數(shù),默認200
minSpareThreads= "20" // 初始化線程數(shù),最小空閑線程數(shù),默認為10
acceptCount= "1000" // 當所有可以使用的處理請求的線程數(shù)都被使用時,可以被放到處理隊列中請求數(shù),請求數(shù)超過這個數(shù)的請求將不予處理,默認100
enableLookups= "false"
URIEncoding= "UTF-8" /> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | net.core.netdev_max_backlog = 32768 net.core.somaxconn = 32768 net.core.wmem_default = 8388608 net.core.rmem_default = 8388608 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.ip_local_port_range = 1024 65000 net.ipv4.route.gc_timeout = 100 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_keepalive_time = 1200 net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_syn_retries = 2 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_mem = 94500000 915000000 927000000 net.ipv4.tcp_max_orphans = 3276800 net.ipv4.tcp_max_syn_backlog = 65536 |