Overflow in Hazelcast Queue Store

Enes Akar | Dec 26, 2013

One of the new features of Hazelcast 3 is the queue store.

Differently from map store; overflow is possible. If you set a memory Iimit; it starts persisting to disk and skipping the memory when queue reaches this limit.

Here the configuration:

                <property name="binary">false</property>
                <property name="memory-limit">1000</property>
                <property name="bulk-load">500</property>

For above configuration:

  • Items will be persisted in their Object form (deserialized one).
  • If the size of the queue has reached 1000 (memory-limit), next element will be just persisted to disk it will not be stored in memory.
  • Items will be loaded from store in bulks with size 500.

Some more notes:

  • Use memory-limit when you avoid over-usage of RAM in case of high load.
  • If you want all items in memory (and store) use Integer.MAX_VALUE, if you want all items just in store then use 0 as memory-limit.
  • If you do not reach the store externally (just hazelcast uses the store) then make the binary configuration to true. That will increase the performance as a step for deserialization will be skipped.

Here you can see some examples of QueueStore implementation:


About the Author

Enes Akar

Co-founder & CTO, Hazelcast Cloud

Enes was one of the early developers of Hazelcast. He joined the company in 2011 with a passion for making distributed computing incredible simple. From 2012 to 2017, he headed the engineering team as VP of Engineering. Since 2017, he has led the development of Hazelcast Cloud, which is enterprise-grade Hazelcast software as a fully managed service in the cloud. Prior to joining Hazelcast, Enes worked in software development and software engineering at telecommunications companies, including Alcatel-Lucent and Ericsson. He holds a Bachelor of Science in Computer Engineering and an MBA from Bogazici University, Istanbul.