Druid數(shù)據(jù)庫連接池介紹_第1頁
Druid數(shù)據(jù)庫連接池介紹_第2頁
Druid數(shù)據(jù)庫連接池介紹_第3頁
Druid數(shù)據(jù)庫連接池介紹_第4頁
Druid數(shù)據(jù)庫連接池介紹_第5頁
已閱讀5頁,還剩11頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、溫紹錦(溫高鐵) http:/ Druid數(shù)據(jù)庫連接池的特點(diǎn) 穩(wěn)定 高效率 可擴(kuò)展 可監(jiān)控 可動(dòng)態(tài)配置 防SQL注入 穩(wěn)定 阿里巴巴大規(guī)模部署 應(yīng)用超過500個(gè) 部署實(shí)例超過3000 最大集群超過60臺(tái) 我們大規(guī)模使用中,開源連接池只有兩個(gè) 是穩(wěn)定的: Druid DataSource Jboss DataSource (歷史原因還在使用) 穩(wěn)定的特性-ExceptionSorter 當(dāng)連接產(chǎn)生不可恢復(fù)的異常時(shí),需要及時(shí) 從連接池中清除,否則會(huì)產(chǎn)生大量錯(cuò)誤。 這個(gè)功能也稱為ExceptionSorter,只有 JBossDataSource和DruidDataSource實(shí)現(xiàn)了這 個(gè)功能。 O

2、racle Fatal Excetion Error Code 28Session has been killed 600Internal oracle error 1012Not logged on 1014Oracle shutdown in progress 1033Oracle initialization or shutdown in progress 1034Oracle not available 1035ORACLE only available to users with RESTRICTED SESSION privilege 1089Immediate shutdown

3、in progres no operations are permitted 1090Shutdown in progress no operations are permitted 1092ORACLE instance terminated. Disconnection forced 1094ALTER DATABASE CLOSE in progress. Connections not permitted MySql Fatal Exception Error Code 1040ER_CON_COUNT_EEROR 1042ER_BAD_HOST_ERRROR 1043ER_HANDS

4、HAKE_ERROR 1047ER_UNKOWN_COM_ERROR 1081ER_IPSOCK_ERROR 1029ER_HOST_IS_BLOCKED 1030ER_HOST_NOT_PRIVILEGED 1045ER_ACCESS_DENIED_ERROR 1004ER_CANT_CREATE_FILE 1005ER_CANT_CREAT_TABLE 1015ER_CANT_LOCK 1021ER_DISK_FULL 高性能 1 線程線程2 線程線程5 線程線程10 線程線程20線程線程50線程線程 Druid1,1021,5091,8891,9042,0071,977 Tomcat-j

5、dbc1,3991,3782,2572,2892,3052,503 DBCP3,1443,8346,2766,4086,5636,783 BoneCP4,3273,5983,8005,2429,40219,066 Jboss-Datasource4,9123,0496,8686,51240,14643,748 C3P018,57019,46715,27019,29428,19566,677 Proxool16,22114,45524,68838,90548,087 (Error) 58,238 (Error) 詳細(xì)測(cè)試信息: https:/ E6%B1%A0%E6%80%A7%E8%83%BD

6、%E5%AF%B9%E6%AF%94%E6%B5%8B%E8%AF%95 Druid是目前性能最好的數(shù)據(jù)庫連接池是目前性能最好的數(shù)據(jù)庫連接池 0 10,000 20,000 30,000 40,000 50,000 60,000 70,000 1 線程2 線程5 線程10 線程20線程50線程 DruidTomcat-jdbcDBCPBoneCPJboss-DatasourceC3P0Proxool SQL Parser Parser基本概念 詞法分析 Token 語法分析 抽象語法樹 表達(dá)式 語句 手寫Parser的性能 Cobar的SQL Parser,從Antlr生成的parser修 改

7、為Druid Parser之后,大約提升6倍的性能。 Druid Parser最近再次大幅度提升性能(50%) SQL Parser的關(guān)鍵在于詞法 詞法分析要支持預(yù)測(cè) 監(jiān)控 Spring關(guān)聯(lián)監(jiān)控 Web關(guān)聯(lián)監(jiān)控 查看SQL執(zhí)行明細(xì) 配置filters=log4j 2013-07-12 16:10:17,966 DEBUG Connection:132 - conn-10001 connected 2013-07-12 16:10:17,970 DEBUG Connection:132 - conn-10001 commited 2013-07-12 16:10:17,970 DEBUG Con

8、nection:132 - conn 10001 rollback 2013-07-12 16:10:17,983 DEBUG Statement:137 - conn-10001, stmt-20000 created 2013-07-12 16:10:17,986 DEBUG Statement:137 - conn-10001, stmt-20000 executed. 0.052501 millis. SELECT 1 2013-07-12 16:10:17,986 DEBUG Statement:137 - conn-10001, stmt-20000 batch executed.

9、 0.041842 millis. SELECT 1 2013-07-12 16:10:18,205 DEBUG Statement:137 - conn-10001, stmt-20000, rs-50000 query executed. 219.082247 millis. SELECT 1 2013-07-12 16:10:18,205 DEBUG ResultSet:142 - conn-10001, stmt-20000, rs-50000 open 2013-07-12 16:10:18,206 DEBUG ResultSet:142 - conn-10001, stmt-200

10、00, rs-50000 Header: null 2013-07-12 16:10:18,206 DEBUG Statement:137 - conn-10001, stmt-20000 update executed. effort 0. 0.019343 millis. SELECT 1 2013-07-12 16:10:18,223 DEBUG Statement:137 - conn-10001, pstmt-20001 created. SELECT 1 2013-07-12 16:10:18,260 DEBUG Statement:137 - conn-10001, pstmt-

11、20001 Parameters : null, null, null, null, com.alibaba.druid.mock.MockBlob34aee875, 1, B471f7458, null, com.alibaba.druid.mock.MockClob620f61e2, null, 1.0, 1, 1, null, com.alibaba.druid.mock.MockNClob5fe36eb9, null, null, null, com.alibaba.druid.mock.MockRef4c7a64dd, com.alibaba.druid.mock.MockRowId

12、77741064, 1, com.alibaba.druid.mock.MockSQLXML64e05280, , null, null, null, null 2013-07-12 16:10:18,260 DEBUG Statement:137 - conn-10001, pstmt-20001 Types : ARRAY, OTHER, DECIMAL, OTHER, BLOB, TINYINT, OTHER, OTHER, CLOB, DATE, FLOAT, INTEGER, BIGINT, OTHER, NCLOB, NVARCHAR, VARCHAR, OTHER, REF, R

13、OWID, SMALLINT, SQLXML, VARCHAR, TIME, TIMESTAMP, OTHER, OTHER 2013-07-12 16:10:18,260 DEBUG Statement:137 - conn-10001, pstmt-20001 executed. 0.564872 millis. SELECT 1 2013-07-12 16:10:18,260 DEBUG Statement:137 - conn-10001, pstmt-20001 batch executed. 0.0075 millis. SELECT 1 2013-07-12 16:10:18,2

14、60 DEBUG Statement:137 - conn-10001, pstmt-20001 Parameters : null, null, null, null, com.alibaba.druid.mock.MockBlob34aee875, 1, B471f7458, null, com.alibaba.druid.mock.MockClob620f61e2, null, 1.0, 1, 1, null, com.alibaba.druid.mock.MockNClob5fe36eb9, null, null, null, com.alibaba.druid.mock.MockRe

15、f4c7a64dd, com.alibaba.druid.mock.MockRowId77741064, 1, com.alibaba.druid.mock.MockSQLXML64e05280, , null, null, null, null 2013-07-12 16:10:18,262 DEBUG Statement:137 - conn-10001, pstmt-20001 Types : ARRAY, OTHER, DECIMAL, OTHER, BLOB, TINYINT, OTHER, OTHER, CLOB, DATE, FLOAT, INTEGER, BIGINT, OTH

16、ER, NCLOB, NVARCHAR, VARCHAR, OTHER, REF, ROWID, SMALLINT, SQLXML, VARCHAR, TIME, TIMESTAMP, OTHER, OTHER 2013-07-12 16:10:18,262 DEBUG Statement:137 - conn-10001, pstmt-20001, rs-50001 query executed. 1.805932 millis. SELECT 1 2013-07-12 16:10:18,262 DEBUG ResultSet:142 - conn-10001, pstmt-20001, r

17、s-50001 open 2013-07-12 16:10:18,263 DEBUG ResultSet:142 - conn-10001, pstmt-20001, rs-50001 Header: null 2013-07-12 16:10:18,263 DEBUG Statement:137 - conn-10001, pstmt-20001 Parameters : null, null, null, null, com.alibaba.druid.mock.MockBlob34aee875, 1, B471f7458, null, com.alibaba.druid.mock.Moc

18、kClob620f61e2, null, 1.0, 1, 1, null, com.alibaba.druid.mock.MockNClob5fe36eb9, null, null, null, com.alibaba.druid.mock.MockRef4c7a64dd, com.alibaba.druid.mock.MockRowId77741064, 1, com.alibaba.druid.mock.MockSQLXML64e05280, , null, null, null, null 2013-07-12 16:10:18,263 DEBUG Statement:137 - con

19、n-10001, pstmt-20001 Types : ARRAY, OTHER, DECIMAL, OTHER, BLOB, TINYINT, OTHER, OTHER, CLOB, DATE, FLOAT, INTEGER, BIGINT, OTHER, NCLOB, NVARCHAR, VARCHAR, OTHER, REF, ROWID, SMALLINT, SQLXML, VARCHAR, TIME, TIMESTAMP, OTHER, OTHER 2013-07-12 16:10:18,263 DEBUG Statement:137 - conn-10001, pstmt-20001 updat

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論