Tuesday, 09 June 2020
The off heap implementation in Infinispan has become much more widely used since its introduction. There have been some issues and improvements identified to get this storage type more in line with its heap counterpart. For those of you that are unware the off-heap setting is actually only "off" the JVM heap and still resides in the native memory of the application.
The best part of all the below changes is the user does not need to change anything, other than configuring Off Heap storage.
For those of you that have used/configured off heap storage before you may have noticed that there was a configuration option named address count. This setting allowed you to configure how many address pointers the container had. You can think of this as essentially how many buckets you have in a HashMap. Unfortunately the number of pointers was fixed and therefore the user would have to know how many elements they expected to have.
This setting also had another problem. If the user required a larger size of elements this would increase startup time as the container can be iterated upon multiple times when it is empty. Iterating over a container of one million empty pointers would be much slower than iterating over one of only 1024 for example.
I am glad to say as of Infinispan 10.0.0.Final this setting and the performance of iteration have been greatly improved.
The address count variable is now ignored and instead the off heap based container will start at smaller amount of "buckets" in the range of 128 or 256. We then apply a load factor of .75, which means we will automatically increase the size of the underlying "buckets" once we have inserted a number of entries being 75% or larger than the current "bucket" size.
The resize operation will grow to have double the amount of "buckets" it had prior. The resize operation will be performed concurrently with other operations, providing minimal blocking as we have locks equal to the number of CPUs times two.
This will allow for a cache with off heap to be started significantly faster and relieves some configuration options that were unneeded. Note that the map, just like a java.util.HashMap, will not decrease the number of "buckets" once it grows to a given size.
I mentioned that iteration was slower during startup of larger number of "buckets". This was due to it possibly having a large number of them, however it was also plauged by an ineffecient way of iterating over them. In addition to rewriting the resize operation, we have also optimized the memory layout so that "buckets" can be iterated sequentially which provides more mechanical sympathy.
This one is rather short and sweet, but the old hash algorithm we used would cause too many collisions for objects that had hash functions that returned values in a similar range, such as java.lang.Integer and java.util.String (with shared startubg characters).
Therefore it has been changed to provide a bit better spreading. This is part of ISPN 10.0.0.Final.
Unfortunately off heap had a few issues with expiration. It didn’t support max idle and expiration metadata was not properly transferred to new nodes during state transfer.
In addition to max idle algorithm being rewritten, Off heap now properly supports max idle as of 10.1.4.Final and 11.0.0.Final.
Off heap metadata transferred to new nodes has been fixed in 10.1.8.Final and 11.0.0.Final.
Tags: off-heap storage
Tuesday, 30 January 2018
Tags: minor release off-heap
Monday, 05 December 2016
It took us quite a bit to get here, but we’re finally ready to announce Infinispan 9.0.0.Beta1, which comes loaded with a ton of goodies.
A new algorithm for non-transactional writes (aka the Triangle) which reduces the number of RPCs required when performing writes
A new faster internal marshaller which produced smaller payloads.
A new asynchronous interceptor core
Avoid the size of the data in the caches affecting your GC times
CaffeineMap-based bounded data container
More reliable eviction
Ickle, Infinispan’s new query language
A limited yet powerful subset of JPQL
Supports full-text predicates
The Server Admin console now supports both Standalone and Domain modes
Pluggable marshallers for Kryo and ProtoStuff
The LevelDB cache store has been replaced with the better-maintained and faster RocksDB
Spring Session support
Upgraded Spring to 4.3.4.RELEASE
We will be blogging about the above in detail over the coming weeks, including benchmarks and tutorials.
The following improvements were also present in our previous Alpha releases:
Graceful clustered shutdown / restart with persistent state
Support for streaming values over Hot Rod, useful when you are dealing with very large entries
Cloud and Containers
Out-of-the box support for Kubernetes discovery
Cache store improvements
The JDBC cache store now use transactions and upserts. Also the internal connection pool is now based on HikariCP
Also, our documentation has received a big overhaul and we believe it is vastly superior than before.
There will be one more Beta including further performance improvements as well as additional features, so stay tuned.
Infinispan 9 is codenamed "Ruppaner" in honor of the Konstanz brewery, since many of the improvements of this release have been brewed on the shores of the Bodensee !
Tags: beta release marshalling off-heap performance query