Sunday, September 25, 2011
New Home...
Monday, August 01, 2011
What Is Terracotta?
Monday, July 11, 2011
Easy Java Performance Tuning: Manage Objects By Size On The Java Runtime Heap

Sunday, May 22, 2011
Exciting Times... Terracotta and Software A.G.
Wednesday, April 20, 2011
Local Caching++
- 40 DB tables in Hibernate that can be cached
- A web cache
- A user session cache
- Hibernate/Lots of caches - When using Hibernate you often end up with as many as 100 tables in your DB. How do you balance a fixed amount of resources(Heap/BigMemory) across 100 caches?
- Indirect knobs/Bytes vs Count/TTL - In local Java caching the control points are almost always measured in number of entries and time to live. But wait a minute! When I start the JVM I don't say how many objects the heap can hold and for how long. I say how many bytes of memory the heap can use?
- Who Tunes and When? - At some companies the desire is to have the "Application Administrator" do the tuning. At others it's the "Developer." They have different understandings of the application. The developer can tune by knowledge of the application. The app admin can only tune based on what's happening when the application is running.
- Tune from the top - Define max resource usage for the whole cache manager and then optionally define it for the individual caches underneath it as needed. So if you have a hundred caches you can start with, "Give these 100 caches N amounts of Heap/OffHeap." Then monitor and see if any specific caches need special attention.
- Tune the constrained resource, Bytes - TTL is a cache freshness concern not a resource management concern. Max entry count does not directly map to available heap resources. So we are adding "bytes" based tuning. This eliminates the mistake prone process of trying to control resources by TTL/TTI/count and hope you get it right. Instead you say, "I want to allow caching to use 30 percent of heap." We take it from there.
Saturday, April 16, 2011
Where To Buy Your Apple Gear?
- The price tag of the device itself
- State sales tax
- Shipping and Handling
- What you can get thrown into the deal
Wednesday, April 13, 2011
Please Strengthen My Weak LinkedIn Links...


Thursday, March 24, 2011
"What" "When" and "Where" ... Quartz Scheduler 2.0 Goes GA
- Resource Availability - CPU available, Memory Available, custom constraints
- Ehcache's data locality - Bring the work to where the data is
- Static allocation - Just decide where it goes
- Easy to use Fluent API - Quartz 2.0 has a new, easy to use fluent interface that hides the complexity of building out the description of your jobs behind a simple description of what you want to happen and when. I wrote a short blog about this when it was in beta.
- Quartz "Where" - Constraint based system for controlling where jobs execute based on things like CPU and Memory usage, OS, and Ehcache data locality
- Quartz Manager - A flash based GUI console for managing and monitoring your scheduler in production.
- Batching - Helps improve a schedulers throughput by allowing one to make trade-offs between perfect time execution and benefiting from batching.
- Ton's of bug fixes and features - Lots of long requested features. Check out the link for the list.
Monday, February 14, 2011
Quick 5:41 Intro To Ehcache Search (Now GA)
- Search - Brand new search API. Allows one to get beyond the key based lookup of objects (Check out this sample)
- Local Transactions - Fast optimistic concurrency without the need for a TransactionManager (Check out this sample)
- Bigger BigMemory (ee) - 2 Billion entries, 1.3 million TPS, Extreme predictability for meeting SLA's
- Bigger Disk Store (ee) - Swap your Ehcache to disk. Grow to hundreds of gigs with no on heap footprint
Wednesday, January 26, 2011
Ehcache At 2 Billion...
What's Up With Ehcache 2.4
Ehcache is the de facto caching standard for Java that everyone uses (500,000+ production deployments; the majority of enterprise Java applications). Ehcache 2.4 is coming out soon and includes some capabilities that will make it even easier to use, more powerful, while still maintaining it's light weight.
The highlights include:
- Search - Quickly find entries based on the criteria of your choosing. String matching, dates, ranges, sums, averages etc.
- Fast local transactions - Improved performance of JTA and added a new non-jta transaction api for user level control
- Even more capacity and performance
What I've been Testing
I've written before about BigMemory for Enterprise Ehcache and how it solves the problem of long, unpredictable GC pauses in Java. The first release of BigMemory was… well, big. In Enterprise Ehcache 2.4, BigMemory has gotten even bigger.
Using the Enterprise Ehcache Big Memory Pounder I was able to show that Enterprise Ehcache 2.4 now easily handles:
- Entry Count: > 2 billion entries (I reached 2 billion on the hardware I had; with bigger hardware, I could probably have gone much higher).
- Throughput: 1.3 million operations per second (symmetric read and write; CPU bound)
- SLA/Predictability: No GC pauses and a predictable 38-42 ops/thread/millisecond throughout the test
- Data Size: 1-350 GB in-memory cache (again, I was limited by the hardware I had; with more RAM, I could probably have gone much higher)
- Flexible Efficient Entry Sizes: The cache can now dynamically handle very large (10-100 MB) and very small entries (just a few bytes) together more efficiently with no tuning (This test used small entries in order to fit as many entries as possible into the memory I had. I also ran tests with fewer entries in order to validate wide ranging sizes)
- Tuning: All tests were done with NO TUNING. Right out of the box.
Here's the hardware and software stack I used for my testing:
Cisco UCS C250 Server
Dual Intel x5670 2.93 Ghz CPU
384 GB RAM ( 8 GB x 48)
Redhat 5.4 Enterprise Edition
Sun JDK 1.6_22
For this test, all of the data was in memory.
A Bit About Ehcache BigMemory
BigMemory is 100% pure Java and in process with a Java application. No magic or special JVMs (works on IBM and JRocket as well). The cache data is safely hidden away from Java GC and the pauses that occur with large heaps by instead storing data in a BigMemory off-heap store.
Embedding
BigMemory got it's start as a component in the Terracotta Server Array and as a result it is particularly useful for embedding. It's performance characteristics and no tuning approach improves "The Out Of The Box Experience" and saves money on support by removing tuning required by users and problems caused by GC pauses.
You may be thinking...
"I don't have 2 billion entries in my caches?"
That's ok. Ehcache is a lightweight core library (under 1MB) for caching that's ubiquitous and easy to use. When it's needed, Ehcache lets you scale up and out to billions of entries and terabytes of data. It does so at a manageable server density without changing code/architecture and without a bunch of tuning and learning. This protects not only your knowledge investment but your code investment.
More about BigMemory for Enterprise Ehcache:
http://terracotta.org/bigmemory
More about the 2010 Ehcache user survey:
Ehcache User Survey Whitepaper
Wednesday, December 15, 2010
Ehcache To The Rescue (Comic Strip)

Monday, November 29, 2010
Quartz Scheduler 2.0 Beta 1 Welcomes New Fluent API and "Where"
- Simplify/modernize the Quartz API.
- Improve the Quartz experience when leveraging a cluster
- The date/time related methods have been moved off of the Trigger and Job classes into a Date building class called "DateBuilder"
- We've removed the need to know details about which Job and Trigger classes you need and instead infer them through the building methods you call.
- The construction now reads more like a sentence. new job withIdentity "job1", "group1". new trigger withIdentity "trigger1", "group1" start at runTime
Ehcache 2.4 Beta 1 Welcomes Search, Local Transactions and more...
- A bit of annoying coding
- Only practical for unclustered caches
- Transactions without a JTA transaction manager
- More speed
- NonStopCache now built in. Rather than have to add a jar and configure a wrapper to get the non-stop characteristics in clustered land this is now built into the product core and be turned on via configuration
- Search now works clustered - The new search API is backed by the Terracotta tier. This is still early and we have a lot of performance and HA work to do here. That said, it is testable and usable so give it a try.
- Explicit locking module is now in the core kit
- Rejoin now works in non-stop (You can disconnect from a cluster and reconnect to that cluster without restarting)
Monday, November 15, 2010
Direct Buffer Access Is Slow, Really?
Type: ONHEAP Took: 8978 to write and read: 10737418368
Type: DIRECT Took: 9223 to write and read: 10737418368
Type: ONHEAP Took: 8827 to write and read: 10737418368
Type: DIRECT Took: 9283 to write and read: 10737418368
Type: ONHEAP Took: 8813 to write and read: 10737418368
Type: DIRECT Took: 9604 to write and read: 10737418368
Friday, November 05, 2010
A Couple Minutes With Ehcache Search...
Friday, October 08, 2010
Strange Talk On Ehcache BigMemory
Wednesday, October 06, 2010
A Couple Minutes With Ehcache BigMemory Pounder...
- Get the Ehcache with BigMemory Beta and a license key to use it.
- Get the Standalone Ehcache Pounder distribution
- Unpack the Ehcache with BigMemory distribution
- Copy the Standalone Ehcache Pounder kit into the ehcache kit and unpack it
- Copy your license file and your ehcache core jar into the pounder kit
Wednesday, September 15, 2010
A Little Bit About BigMemory for Ehcache and Terracotta ...
In talking to our users it is clear that applications are getting more and more data hungry. According to IDC, data requirements are growing at an annual rate of 60 percent. This trend is driven further by cloud computing platforms, company consolidation and huge application platforms like Facebook. There is good news though. Server class machines purchased this year have a minimum of 8 Gig of RAM and likely have 32 Gig. Cisco is now selling mainstream UCS boxes with over 380 Gig of RAM (which I have tried and is amazing). On EC2 you can borrow 68.4 Gig machines for 2 dollars an hour (I have also tried this and it is also pretty amazing). Memory has gotten big and extremely cheap compared to things like developer time and user satisfaction.
Unfortunately a problem exists as well. For Java/JVM applications it is becoming an ever increasing challenge to use all that data and memory. At the same time that the data / memory explosion is occurring the amount of heap a Java process can effectively use has stayed largely unchanged. This is due to the ever increasing Garbage Collection pauses that occur as a Java heap gets large. We see this issue at our customers but we also see here at Terracotta tuning our products and the products we use like third party app servers, bug tracking systems CMS's and the like. How many times have you heard "run lots of JVM's" or "don't grow the heap" from your vendor's and/or devs?
So we set out to first identify the problem as it exists today, both in the wild and in-house. We then created a solution, first for us (an internal customer) and then for all of the millions of nodes of Ehcache out there (all of you)
3 Big Problems Seen by Java Applications
My Application is too slow
My application can't keep up with my users. I've got 10's of gigs of data in my database but it's over loaded and or too slow to service my needs. Either due to the complicated nature of my queriers or the volume of those queries. I want my data closer to the application so of course I start caching. Caching helps, but I want to cache more. My machine has 16 gigs of RAM but if I grow my heap that large, I get too many Java GC pauses.
My Application's latencies aren't predictable
On average my Java application is plenty fast but I see pauses that are unacceptable to my users. I can't meet my SLA's due to the size of my heap combined with Java GC pauses.
My software/deployment is too complicated
I've solved the Java GC problem. I run with many JVM's with heap sizes of 1-2 gigs. I partition my data and or loadbalance to get the performance and availability I need but my setup is complicated to manage because I need so many JVM's and I need to make sure the right data is in the right places. I fill up all 64 Gig's of RAM on my machine but it's too hard and fragile.
The other problem
Like many vendors, in the past we told our users to keep the heaps down under 6 gig. This forced our customers to not completely leverage the memory and or cpu on the machines they purchased and or stack JVM's on a machine. The prior is expensive and inefficient and the latter fragile and complex.
Here is a quick picture of what people do with their Java Applications today:
Base Case - Small heap JVM on a big machine because GC pauses are a problem
Big heap - That has long GC's that are complicated to manage
Stacked small JVM heaps - This in combination with various sharding, load balancing and clustering techniques is often used. This is complicated to manage and if all the nodes GC at the same time this can lead to availability problems.

What kind of solution would help?
Here's what we believe are the requirements for a stand-alone caching solution that attacks the above problems.
- Hold a large dataset in memory without impacting GC (10s-100s of Gig) - The more data that is cached the less you have to go to your external data source and or disk the faster the app goes
- Be Fast - needs to meet the SLA
- Stay Fast - Don't fragment, don't slowdown as the data is changed over time
- Concurrent - Scales with cpu and threads. No lock contention
- Predictable - can't have pauses if I want to make my SLA
- Needs to be 100 percent Java, work on your JVM on your OS
- Restartable - A big cache like this needs to be restartable because it takes too long to build
- Should just Snap-in and work - not a lot of complexity
What have we built?
First we built a core piece of technology, BigMemory, an off-heap, direct memory buffer store, with a highly optimized memory manager that meets and or exceeds requirements 1-6 above. This piece of technology is currently being applied in two ways:
1) Terracotta Server Array - We sold it to our built-in customer, the Terracotta Server Team, who can now create individual nodes of our L2 caches that can hold a hundred million entries, leverage 10's of gigs of memory, pause free and with linear TPS. This leverages entire machines (even big ones) with a single JVM for higher availability, a simpler deployment model, 8x improved density and rock steady latencies.
2) Ehcache - We've added BigMemory and a new disk store to Enterprise Ehcache to create a new tiered store adding in requirements 7-8 from above (snap-in simplicity and restart-ability). The Ehcache world at large can benefit from this store just as much as the Terracotta products do.
Check out the diagram below.

Typically, using either of the BigMemory backed products, you shrink your heap and grow your cache. By doing so SLA's are easier to meet because GC pauses pretty much go away and you are able to keep a huge chunk of data in memory.
Summing up
Memory is cheap and growing. Data is important and growing just as fast. Java's GC pauses are preventing applications from keeping up with your hardware. So do what every other layer of your software and hardware stack does: cache. But in Java, the large heaps needed to hold your cache can hurt performance due to GC pauses. So use a tiered cache with BigMemory that leverages your whole machine and keeps your data as close to where it is needed as possible. That's what Terracotta is doing for it's products. Do so simply, i.e. snap it in to Ehcache and have large caches without the pauses caused by GC. As a result create a simpler architecture with improved performance/density and better SLA's.
Learn more at http://terracotta.org/bigmemory
Check the Ehcache BigMemory docs
