I have been waiting for enough people to move to Java 5 to mandate it
as a minimum standard for ehcache. At JavaOne 2008 I found out that a
lot of people were still to make the move. Now that we are in 2009 I
have decided to move to Java 5. As part of this I have done a general
cleanup of the core. I can now retire backport-concurrent which has
served the project well (thanks guys) and other dependencies.
Ehcache-1.6 core has no dependencies.
I decided that with the improvements in concurrency support that
have come along, it was time to move beyond the use of synchronized.
Years ago I adopted striped locking on BlockingCache which gave amazing
results but I left the core pretty much as it was. The rework adopts
some new goodness in Java 5 such as CopyOnWriteArray and
ConcurrentHashMap. Having said that there is nothing in Java 5 for
eviction, so the new work relies heavily on some excellent
contributions to provide performance for caching application that is
not available in Java 5.
On my own
concurrency tests, which use 70 threads simulating a typical load
against a single cache, I get the following improvements in ehcache-1.6
over ehcache-1.5. (Note 70 are just for that cache. Ehcache typically
has many caches, so this translates to a production system with
thousands of threads against all caches)
Operation
|
Number of Times Faster
Than Ehcache-1.5.0
|
get
|
92.5 times faster
|
put
|
30 times faster
|
remove
|
48 times faster
|
removeAll
|
80 times faster
|
keySet
|
30 times faster
|
Manik Surtani maintains a cache performance benchmark tool. Using that
I have added ehcache-1.6. It shows dramatically the performance
increases in Ehcache-1.6.
For those with less than perfect eyesight, the second column, which is
too short to even have its time printed, is the ehcache-1.6
performance.
What these
charts are saying, is that an ehcache, with 25 concurrent threads, is
now much faster than it was. The single threaded case it no faster. But
caches are not about single threads.
Now, in case everyone gets preoccupied on the comparsions between Java caches, here is an old Ehcache versus Memcached chart.
If I redid this chart using ehcache, the barely visible columns for ehcache would completely disappear on this scale.
So
what is this really saying? An in-process cache, which uses a few tens
of CPU operations to access data already held in memory, is much, much,
much faster than going out over the network for some data, regardless
of how slick the server implementation at the other end is.
But
I recognise that Memcached is about a different type of caching:
massive partitioned caches. The Ehcache project has the Ehcache Server
for that, with RESTful and SOAP APIs. The RESTful implementation uses a
variety of tricks such as conditional get, the ability to have hardware
and software load balancers (think ngnx) perform URI routing, head,
HTTP1.1 compression and pipelining plus the goodness of modern NIO Java
Web Containers to seriously give memcached a run for its money. I will
be doing some performance comparisons between Memcached and Ehcache
Server in the near future.
What
else is next? The above numbers are for MemoryStore based caches. I am
also going to give the DiskStore a work over, with lots of suggestions
made to me in the last year. Stay tuned.
分享到:
相关推荐
ehcache1.6,ehcache-web-2.0.4,slf4j-api-1.7.21.jar 不好意思,缺点分用。。
ehcache和h2 database资料
Ehcache2缓存区配置详解.pdf
1)Demo 学习要点简介: ...2.Eclipse 导入后可能需要在 Xml Catalog 手动添加:ehcache-spring-1.2.xsd(ehcache-spring-annotations-1.2.0-sources.jar里面有,自己找下)。 3.内附Oracle建表等可执行语句。
1.解压缩到目录下,复制ehcache-monitor-kit-1.0.0\lib\ehcache-probe-1.0.0.jar包到application的web-inf/lib目录下 2.将以下配置copy的ehcache.xml文件的ehcache标签中,注:上述链接中说的配置少写了个probe包名...
SpringBoo2.x整合Ehcache3.x作为缓存底层存储。
ehcache-2.7.3-distribution.tar.gz
jar包,官方版本,自测可用
hibernate+ehcache hibernate+ehcache hibernate+ehcache hibernate+ehcache hibernate+ehcache
ehcache-3.8.1.jar
EhCache
EhCache 是一个纯 Java 的进程内缓存框架,具有快速、精干等特点,是 Hibernate 中默认的 CacheProvider。Ehcache 是一种广泛使用的开源 Java 分布式缓存。主要面向通用缓存,Java EE 和轻量级容器。它具有内存和...
赠送jar包:ehcache-3.9.9.jar; 赠送原API文档:ehcache-3.9.9-javadoc.jar; 赠送源代码:ehcache-3.9.9-sources.jar; 赠送Maven依赖信息文件:ehcache-3.9.9.pom; 包含翻译后的API文档:ehcache-3.9.9-javadoc-...
hibernate ehcache.xml 配置详解
jar包,官方版本,自测可用
ehcache-2.10.6.jar ehcache jar包供各位开发人员 学习、交流,切勿用于商业用途。
2、由于要实现Ehcache缓存页面,所以必须要添加“ehcache-web-2.0.4.jar” jar包,该jar包主要用于辅助Ehcache实现页面缓存 注意: 本web工程的发布不要使用Tomcat7,否则会出现如下异常: 2015-3-25 9:53:50 org....
spring3整合EhCache注解实例
ehcache所需的ehcache-core-2.5.2.jar及其源码ehcache-core-2.5.2-sources.jar
EhCache 是一个纯Java的进程内缓存框架,具有快速、精干等特点,是Hibernate中默认的CacheProvider。 Ehcache是一种广泛使用的开源Java分布式缓存。主要面向通用缓存,Java EE和轻量级容器。它具有内存和磁盘存储,...