[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Optimal size for In memory store  XML
Forum Index -> Ehcache
Author Message
sjmittal

neo

Joined: 01/27/2012 03:44:27
Messages: 7
Offline

Hi,
I was looking at EHCache configuration.

I find that you can size the in memory store using maxBytesLocalHeap property.

I wanted to know what is usually considered optimal value for this.

I looked at this http://ehcache.org/documentation/configuration/bigmemory#performance-comparisons and found that a large value for this property may have some performance issues with local heaps.

So is there a number beyond which it is not advisable to set the size of local heap.

We are caching big entries of size greater than 100 KB and there are many of these. So wanted to figure out how many can be effectively cached in memory stores.

Thanks
Sachin

About Me: http://www.assembla.com/space/sachin_mittal
[WWW]
steve

ophanim

Joined: 05/24/2006 14:22:53
Messages: 619
Offline

It really depends on your application, how much memory you are starting your JVM with and how much memory you need for the rest of your application. BTW, you can also specify as a percentage of the heap the JVM is started with if that is out of your control.

Want to post to this forum? Join the Terracotta Community
sjmittal

neo

Joined: 01/27/2012 03:44:27
Messages: 7
Offline

steve wrote:
It really depends on your application, how much memory you are starting your JVM with and how much memory you need for the rest of your application. BTW, you can also specify as a percentage of the heap the JVM is started with if that is out of your control. 


We are starting JVM with 4 GB of memory.

Rest of the application may need around 2 GB of memory.

We have estimated based on average size of data and approximate number of objects we need to cache, we need around 1 GB of memory to allocate for this.

So question if if we set the maxBytesLocalHeap as 1 GB VS say we set that as maxBytesLocalHeap 512 MB, would the performance of putting and getting data from the cache would be same in both cases.

Is there some upper limit for maxBytesLocalHeap to ensure caches perform optimally?

Does higher value for maxBytesLocalHeap causes any performance degradation?

Thanks
Sachin

About Me: http://www.assembla.com/space/sachin_mittal
[WWW]
steve

ophanim

Joined: 05/24/2006 14:22:53
Messages: 619
Offline

The performance of the cache should not be impacted by that setting. The only thing it should impact is how much heap it uses for the cache. The performance differences mentioned in docs and blogs are about the benefits of efficiently using the heap you have to avoid GC and avoid recreating state from external sources.

Does that make sense?

Want to post to this forum? Join the Terracotta Community
sjmittal

neo

Joined: 01/27/2012 03:44:27
Messages: 7
Offline

Hi,
Could you please guide me how do I efficiently manage the heap. If there is a part of documentation or blog article I should read. Any links here would be of great help.

I am using open source version of ehCache so for store I have in memory store and disk store only as my options.

How do I ensure that most of the time my objects are stored in memory only and not get overflowed to the disk.

I guess setting a big value to maxBytesLocalHeap will ensure this.

Thanks
Sachin

About Me: http://www.assembla.com/space/sachin_mittal
[WWW]
ilevy

consul

Joined: 04/16/2008 10:26:42
Messages: 357
Offline

Typically you could start by allocating as much of the heap that is available to Ehcache to the target cache. Then observe performance, noting the impact of GC. If GC cycles are taking a toll, you'll have to take measures including possibly reducing the size of the cache.

Some docs that may help:

http://www.ehcache.org/documentation/operations/garbage-collection

http://www.ehcache.org/documentation/configuration/cache-size

http://www.ehcache.org/documentation/configuration/data-life

There is also a best-practices guide on terracotta.org (http://terracotta.org/documentation/best-practices) -- even though you are not using Terracotta clustering, you might find something useful in there about GC issues. Note that that doc may not be published for another day.
 
Forum Index -> Ehcache
Go to:   
Powered by JForum 2.1.7 © JForum Team