Atitit 物化視圖與觸發(fā)器性能測試方法 attilax總結(jié) 1.1. 觸發(fā)器主要影響更新性能。。。 1 1.2. 臨時打開關(guān)閉觸發(fā)器,如果db不支持可以更改條件使其不觸發(fā) 1 1.3. 打開定時
掃描二維碼
隨時隨地手機(jī)看文章
Atitit 物化視圖與觸發(fā)器性能測試方法 attilax總結(jié)
?
1.1. 觸發(fā)器主要影響更新性能。。。 1
1.2. 臨時打開關(guān)閉觸發(fā)器,如果db不支持可以更改條件使其不觸發(fā) 1
1.3. 打開定時器更新模式測試 1
1.4. 性能收集 1
1.5. 性能收集 代碼 2
2. 參考資料 3
?
1.1.?觸發(fā)器主要影響更新性能。。。?
可以批量并發(fā)測試插入更新性能。。。
?
1.2.?臨時打開關(guān)閉觸發(fā)器,如果db不支持可以更改條件使其不觸發(fā)1.3.?打開定時器更新模式測試1.4.?性能收集不帶觸發(fā)器 ?50線程并發(fā)
?
---------執(zhí)行時間:1766ms,avgtime: 656ms,cnt:598,alltime:392320
?
?
?
觸發(fā)器下 ?并發(fā)線程50人
-執(zhí)行時間:2491ms,avgtime: 2066ms,cnt:70,alltime:144638
?
?
觸發(fā)器下 30人
---------執(zhí)行時間:758ms,avgtime: 2016ms,cnt:169,alltime:340734
?
20人
---------執(zhí)行時間:741ms,avgtime: 1319ms,cnt:89,alltime:117392
?
?
觸發(fā)器下 ?并發(fā)線程10人
---------執(zhí)行時間:805ms,avgtime: 736ms,cnt:89,alltime:65578
?
1.5.?性能收集 代碼要收集本
?
/oploggerPrj/src/com/attilax/oplog/util/MatViewTest2_dpt1.java
package com.attilax.oplog.util;
?
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicLong;
?
import org.apache.ibatis.session.SqlSession;
?
import com.attilax.oplog.OperLogUtil;
?
import cn.freeteam.util.MybatisSessionFactory;
?
public class MatViewTest2_dpt1 {
?
public static AtomicLong all_int = new AtomicLong(0);
public static AtomicLong cnt = new AtomicLong(0);
public static AtomicLong avg = new AtomicLong(0);
?
synchronized private static void calcNout(long excTime) {
all_int.addAndGet(excTime);
cnt.incrementAndGet();
avg.set(all_int.get() / cnt.get());
System.out.println("---------執(zhí)行時間:" + excTime + "ms,avgtime: " + avg + "ms,cnt:" + cnt + ",alltime:"
+ all_int);
}
?
?
2.?參考資料Atitit 并發(fā)測試耗時時間工具
Atitit 并發(fā)測試 ??(結(jié)果報告)
?
?