首页   快速返回

aerospike存储引擎配置实例
文章分类 aerospike
发布时间 2019-03-20 修改时间 2019-03-20
What is the Difference Between Storage Engine Memory and Data-In-Memory
https://discuss.aerospike.com/t/what-is-the-difference-between-storage-engine-memory-and-data-in-memory/4407


Storage Engine
内存模式  持久化模式 
data-in-memory


纯内存模式

namespace test {
        replication-factor 2
        memory-size 4G
        default-ttl 30d # 30 days, use 0 to never expire/evict.

        storage-engine memory
}




persisted namespace on a device

namespace bar {
        replication-factor 2
        memory-size 4G
        default-ttl 30d # 30 days, use 0 to never expire/evict.

       storage-engine device {
               device /dev/sdb
               data-in-memory false 
     }
}


For a file-backed namespace

storage-engine device {
               file /opt/aerospike/data/bar.dat
               filesize 16G
               data-in-memory false 
}



data-in-memory 模式


namespace bar {
        replication-factor 2
        memory-size 4G
        default-ttl 30d # 30 days, use 0 to never expire/evict.
        storage-engine device {
               file /opt/aerospike/data/bar.dat
               filesize 16G
               data-in-memory true # Store data in memory in addition to file.
       }
}

this namespace stores data in the file /opt/aerospike/data/bar.dat, 
and also holds the same data in memory.

This latest feature will also eliminate the risk of deleted records being re-indexed during a restart.


In terms of system load, the difference between the two different configurations 
should be negligible if sized correctly. 

就系统负载而言,如果大小正确,两种不同配置之间的差异应该可以忽略不计。


In some cases, though, depending on the system configuration 
and especially the swappiness and memory related tuning, 
persisted namespaces with data-in-memory set to true 
may experience occasional spikes in load and latencies corresponding to 
the system managing the file cahce involved in storing the data on a file. 
不过,在某些情况下,根据系统配置,特别是与swappiness和内存相关的调优,data-in-memory设置为true的持久化名称空间可能会偶尔出现负载峰值,

保存数据到文件 ,文件系统管理的文件缓存 ,可能会导致 偶尔出现负载和延迟峰值


Finally, namespaces in memory without persistence do not have a limit to the record size 
(whereas persisted namespaces limit the record sizes to the configured write-block-size )


纯内存namespace记录大小没有限制
持久化namespaces记录大小限制 通过 write-block-size  参数配置


Please be aware that the above configuration (data-in-memory true with disk persistence) 
should not be used as an alternative if the storage subsystem is not able of handling the write-load by it self. 

请注意,如果存储子系统不能自己处理写负载,则不应使用上面的配置(持久化并且data-in-memory设置为true)作为替代。




In case of workloads that do not read a record prior to updating it (pure replace or new record creations), 
if the storage subsytem is not capable of handling the workload (when data-in-memory is set to false), 
then moving to data-in-memory with the same disk as persistence will not help and will most likely lead to queue too deep issues


如果存储子系统不能处理工作负载, data-in-memory  设置为 true 可能导致 queue too deep 


Warning: write fail: queue too deep
https://discuss.aerospike.com/t/why-do-i-see-a-warning-write-fail-queue-too-deep/3009


In case of read-update workload, moving to a data-in-memory true configuraion 
will help as the reads will be from memory rather than from the storage subsystem.

在读写场景下,data-in-memory 设置为true 可以提升读性能

上一篇     下一篇
开发自己的maven插件

aerospike的一些限制

aerospike data-in-memory 机制说明

aerospike存储机制

aerospike架构概述

aerospike缓冲和缓存机制