« Clustering JBoss in the Amazon EC2 Cloud | Main | Binding JBoss to a Different set of Ports »

June 17, 2008

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83549840569e200e5535b36e08833

Listed below are links to weblogs that reference EhCache vs Memcached caching for JEE Applications:

Comments

no

Hugo Troche

No? You mean that you don't agree with the results or that I should do more extensive testing?

googlebot

You should have tried to run either caches on a separate machine, so your app server would access them via tcp/ip.
I believe memcached was so slow in your example because it used serialization and ehcache did not. Serialization is a serious bottle neck, you should consider using externalization instead.

Hugo Troche

Thank you for commenting. You are right, the equation is different when the cache is in a different machine that the application server.

The question then is: in a distributed cache environment, will Memcached be faster?

It could be an interesting test to try it out. On the other hand, the performance of the cache in the case where the cached object is in the same box as the application server will be orders of magnitude better. So, if the application has two servers, 50% of the cache calls should be local. If the application has 3, 33% should be local, etc. That along could be a big performance difference in the system. Also, EhCache does not distribute objects like Memcached and that would have to be taken into account. Again, without actually testing this is just speculation.

vpupkin

This comparison is not really clean. Memcached was designed to increase performance for multi-server enviroment, but not for only one JVM. For sure additional serialisation will produce additinal performance-leak, but...


...it is nothing in comparison with pure( for ex. ) database access. Try to improve your tests with 10000 DB-selects from 2,4,8.. different servers with and without both of caches...


and then pls share your test-resuls! ;)

Doug

Hi,
You are not comparing apple to apple here. EhCache is residing in the same JVM with your app server, memcached is not. I would said that in a distributed test, memcached would beat ehcache. But how to put EhCache in a distributed environment is a myth to me!

memcached is as much a *scaling* solution as it is a performance solution. This is like testing mapreduce using a single box.

Steve

As of today, ehcache's JCache page says,

"Ehcache provides a preview implementation of JSR107 via the net.sf.cache.jcache package."

AFAIK it's not yet standardised.

Steve

Another thing you don't mention is the GC churn caused by an in-process cache. With a large heap, this can be big performance problem. Use of an out-of-process cache can mitigate this problem.

Sameer Charles

To me this test just does not make any sense, a single box test on a highly scalable distrubuted caching system like memcached? hmm.

In addition I agree with Steve that JCache is not yet final and its "inactive" which means nothing happens there since 1.5 years. This basically means that either the expert committee is not able to agree on the spec or the spec reached a level where it has serious problems.

Personally I like ehCache implementation of JCache but this does not mean that I will just select it for any J2EE application.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment