21 Kasım 2022 Pazartesi

hazelcast.xml - High Density (HD) Memory Store Ayarları

Giriş
Bu özellik sadece Hazelcast Enterprise sürümünde var. Açıklamalar şöyle
Size: Size of the total native memory to allocate. Default value is 512 MB

Allocator type: Hazelcast has 2 types of mechanism for allocating memory to HD.
 1. STANDARD: allocate memory using default OS memory manager. Standard allocation works fine with large objects as the number of allocations will not be high. But for smaller objects where the system would require to perform many allocations of memory blocks, performance would be affected due to the allocator being a singleton resource that is shared among all threads. It uses malloc()/free() from standard glibc library to allocate memory and these are slow operations when performed by a single but shared resource.
 2. POOLED: is Hazelcast’s own pooling memory allocator and the default strategy. It allocates memory in fairly large blocks (4mb by default). These large blocks may further split into smaller blocks to form a pool when required. The allocator can also decide to merge these smaller blocks back to create a big block if/when required. The allocation is based on buddy allocation policy. Memory allocation happens on demand; as opposed to Standard allocation, local memory pools are allocated per-thread every time when memory is required to store data. The allocation is similar to tcmalloc but without passing blocks between threads. This makes the allocation faster and efficient.

Page size: Size of the page in bytes to allocate memory as a block. It is used only by the POOLED memory allocator. Default value is 1 << 22 = 4194304 Bytes, about 4 MB.

Minimum block size: is the size of smallest block that will be allocated. It is used only by the POOLED memory allocator. Blocks are configured in power-of-2 sizes. One memory block does not store 2 entries, resulting in possible fragmentation. For example, if you have a block configured to be of 16 KB and the entry size is 12 KB, there will be a wastage of 4 KB. If the entry happens to be 20 KB in size then one block of 32 KB will be used, leaving 12 KB of unused space in memory block, causing higher internal fragmentation. Therefore, tune this property carefully when you know the in-memory size of your object, to reduce internal memory fragmentation. Also, be careful in not setting this value to a very low number as smaller block leads to more internal fragmentation due to the overhead of block header, metadata structures, more heavyweight buddy-merging process and hence, much higher chance of external fragmentation. In most cases, you won’t need to go lower than the default of 16 bytes.

Metadata space percentage: Defines the percentage of the allocated native memory that is used for the metadata of other map components such as index (for predicates), offset, etc. It is used only by the POOLED memory allocator. Default value is 12.5. Set this to a higher number if the number of entries is in the region of few millions and/or have indexes, otherwise an exception is thrown when metadata space fills up completely.
Örnek
Şöyle yaparız
<native-memory enabled="true" allocator-type="POOLED">
  <size unit="MEGABYTES" value="102400"/>
  <min-block-size>32</min-block-size>
  <page-size>4194304</page-size>
  <metadata-space-percentage>20.0</metadata-space-percentage>
  <persistent-memory enabled="false" mode="MOUNTED"/>
</native-memory>
Kullanacağımız Map veya veri yapısı tanımında şöyle olmalı
<in-memory-format>NATIVE</in-memory-format>
Örnek - persistent-memory
Şöyle yaparız
<native-memory enabled="true" allocator-type="POOLED">
  <size unit="GIGABYTES" value="128"/>
  <persistent-memory enabled="true" mode="SYSTEM_MEMORY"/>
</native-memory>
Açıklaması şöyle
You can configure the HD (high-density) memory store with regular RAM available on the machine, but to enable the persistent memory implementation you need the actual Intel Optane persistent memory hardware.



Hiç yorum yok:

Yorum Gönder

THIRD-PARTY.txt Dosyası

Kullanılan harici kütüphanelerin sürümleri bu dosyada Dosyanın yolu şöyle hazelcast/licenses/THIRD-PARTY.txt