上次用Coherence實現緩存數據同步的transport manager之后,對它進行了壓力測試并和Tibco EMS JMS和 OracleAS JMS(內存)進行了性能對比。
測試需求
解決方案
運行測試之前,根據不同的情況,需要修改一下配置文件, 需要配置文件主要是方便在各種同步方案之間切換, 也方便我們更換不同的測試環境, J2EE container和 Oracle DB:tts.properties
#one of jms, rmi,oasjms, coherence or set it blank
toplink.cache.type = jms
#the name of toplink command channel
toplin.command.channel = Toplink Coherence

#the config is used for stress test

#not use datasource
database.driver=oracle.jdbc.OracleDriver
database.url=jdbc:oracle:thin:@luga:1521:lugadb
database.username=gavin
database.password=gavin
#using datasource
database.dataSource =

#thread number
#default 30
read.thread.number = 20
#default 10
update.thread.number = 10
#default 10
create.thread.number = 10
#time unit is minute default 30
test.run.duration = 360

#url
test.server.url = http\://localhost\:7778
toplink.cache.type可以為jms, oasjms, rmi, coherence或者不填。
test.run.duration:: 執行時間單位分鐘
datasource:配了datasource就會首先使用datasource
實現技術;
1.服務器端(Oracle Application Server):servlet接受請求并對employee做相應處理,計算測試結果
2.客戶端(Eclipse):commons-httpclient多線程發送請求,記錄測試結果
測試結果:
三者都成功實現了數據在多個jvm之間的及時同步, 性能上比較
Oracle AS JMS (內存)> EMS JMS>Oralce Coherence
如何實現toplink 自定義的transport manager:Oracle Coherence實現toplink會話緩存的數據同步