post | sidebar | footer

November 10, 2005

Tomcat 5.5.7 效能調整

0 迴響
雖然還沒找到效能稱不過 2x 人同時上線的原因,不過還是把 java 的 Xms 和 Xmx 做調整。


測試機的記憶體是 512M,所以在 {$TOMCAT_HOME}/bin/catalina.sh 裡,預設值 JAVA_OPTS="-server -Xmx178m -Xms178m" 改成 JAVA_OPTS="-server -Xms320m -Xmx512m"。


當 java -server -Xmx512m -Xms512m 在 std1 測試


#ab -dSk -c100 -n100 http://itblog.eztravel.com.tw/


  Server Software: Apache/2.0.54

  Server Hostname: itblog.eztravel.com.tw

  Server Port: 80



  Document Path: /

  Document Length: 42246 bytes



  Concurrency Level: 100

  Time taken for tests: 64.345 seconds

  Complete requests: 100

  Failed requests: 0

  Broken pipe errors: 0

  Keep-Alive requests: 0

  Total transferred: 4575165 bytes

  HTML transferred: 4542083 bytes

  Requests per second: 1.55 [#/sec] (mean)

  Time per request: 64345.00 [ms] (mean)

  Time per request: 643.45 [ms] (mean, across all concurrent requests)

  Transfer rate: 71.10 [Kbytes/sec] received



  Connnection Times (ms)
min
avg
max
Connect:
47
387
6245
Processing:
5631
28227
64073
Total:
5631
28615
64340




當 java -server -Xms320m -Xmx512m 在 std1 測試


#ab -dSk -c100 -n100 http://itblog.eztravel.com.tw/

  Benchmarking itblog.eztravel.com.tw (be patient).....done

  Server Software: Apache/2.0.54

  Server Hostname: itblog.eztravel.com.tw

  Server Port: 80



  Document Path: /

  Document Length: 453 bytes



  Concurrency Level: 100

  Time taken for tests: 6.380 seconds

  Complete requests: 100

  Failed requests: 0

  Broken pipe errors: 0

  Non-2xx responses: 102

  Keep-Alive requests: 0

  Total transferred: 71094 bytes

  HTML transferred: 46206 bytes

  Requests per second: 15.67 [#/sec] (mean)

  Time per request: 6380.00 [ms] (mean)

  Time per request: 63.80 [ms] (mean, across all concurrent requests)

  Transfer rate: 11.14 [Kbytes/sec] received



  Connnection Times (ms)
min
avg
max
Connect:
125
317
1192
Processing:
588
3567
5393
Total:
588
3885
5712





參考資料:http://linux.vbird.org/linux_server/0360apache.php#apache_speed