Oracle 11g 數據庫連接池DBCP和Proxool性能對比
背景
公司的產品一直使用的是DBCP作為連接池。但是最近在客戶環境發現當并發增加時,宕機鳥。已經對數據庫查詢進行了優化,但是還是會發生Tomcat宕機的情況,想到更換數據庫連接池。
But換或者不換都要有數據佐證嘍。因此著手測試對比。
測試環境
應用服務器 | Tomcat 5.5 |
測試工具 | JMete 2.8 |
數據庫 | Oracle 11g |
DBCP & Proxool
maxId | 10 |
minId | 5 |
測試場景:系統登錄(一次登錄操作需要>14次的數據庫連接操作)
測試結果(20秒內模擬50個進程循環3次)
DBCP
sampler_label | aggregate_report_count | average | aggregate_report_median | aggregate_report_90%_line | aggregate_report_min | aggregate_report_max | aggregate_report_rate | aggregate_report_bandwidth |
login:HTTP請求 | 150 | 6906 | 6262 | 13137 | 461 | 16022 | 3.071505 | 1.643735 |
總體 | 150 | 6906 | 6262 | 13137 | 461 | 16022 | 3.071505 | 1.643735 |
proxool
sampler_label | aggregate_report_count | average | aggregate_report_median | aggregate_report_90%_line | aggregate_report_min | aggregate_report_max | aggregate_report_rate | aggregate_report_bandwidth |
login:HTTP請求 | 150 | 2959 | 3165 | 4620 | 8 | 5522 | 4.797083 | 5.380354 |
總體 | 150 | 2959 | 3165 | 4620 | 8 | 5522 | 4.797083 | 5.380354 |
結論
1. 從以上測試結果看,proxool的性能明顯優于DBCP。
2. 另外針對Tomcat 5.5和Tomcat 6.0也做了測試,發現Tomcat不同版本間的差異并不大,因此決定暫時不更換應用服務器。
下一步
利用jrockit分析系統內存泄露情況,進行改進。
posted on 2013-01-14 14:27 amenglai 閱讀(826) 評論(0) 編輯 收藏 所屬分類: Java性能