Lock occurs at com.ibatis.common.beans.ClassInfo#getInstance in case of cacheEnabled = true
In heavy traffic , lock occurs at com.ibatis.common.beans.ClassInfo#getInstance
in case of cacheEnabled = true
.
It seems to be happend because of "double synchronized"
The following is interesting article related to the above issue.
The above article says that we'd better use java.util.concurrent.ConcurrentHashMap (in JDK 5) rather than Collections.synchronizedMap, Hashtable or synchronized block.
Here is another article worth reading.
Race conditions in Throttle lead to thread blockage popping items from ThrottledPools under stress.
com.ibatis.common.util.Throttle
seems to be a mechanism for iBATIS to control concurrent load, but causes few problems. Throttle is removed entirely in 2.3.1.
The test I involved showed 20% enhancement of throughput under high congestion after removing wait and notify from com.ibatis.common.util.Throttle
and applying ConcurrentHashMap
to com.ibatis.common.beans.ClassInfo.getInstance()
. The tested application was stock trading application which had about 12,000 lines in all and consisted of 8 stateless local session beans using iBATIS 2.3 for data access. The application had about 12,000 lines. The application was on a IBM machine which had 10 PowerPC POWER6 CPUs and 16GB RAM. The stress test showed 2,400TPS before and 2,900TPS after the fixing.
0 comments:
Post a Comment