Ignite Configuration 2.6-IGFS Speed--做backups/disk异步写入?
Ignite Configuration 2.6-IGFS Speed--do backups/disk writes Asynchronously?
我正在水平扩展时调整我的 ignite 集群的性能。我的用例是保存到 IGFS 中的文件。中值大小约为 2 M,最大大小为 120G,95% 约为 1 G。严重偏向于更小的大小。
我的模型是丢失数据是可以的,因为每条数据都可以在性能下降的情况下恢复。但是,如果成员出现故障,我不想让我的 ignite 集群损坏,因为重新获取所有数据对我的用户(以及我自己)来说将是非常糟糕的一天。
另一方面,我希望保存速度尽可能快。因此,我采用的方法是,驱逐数据是可以的,并且在一些节点出现故障时丢失一些数据也可以,只要我在中断中丢失的数据不超过 10%。
我有一个名为 "igfs" 的 FileSystemConfiguration,我希望它延迟保存到也名为 "igfs" 的 DataStorageConfiguration。
为了有一些冗余,我将 ignite 设置为使用 IgniteConfiguration.AtomicConfiguration.backup = 1 的 1 个备份。我认为这意味着 ignite 中的每个条目都会写入一个副本。但是,我希望备份异步发生。我找不到对 IGFS 条目执行此操作的方法。有办法吗?
此外,是否有办法将 igfs 设置为延迟写入默认持久层(基于磁盘)?我真的很想完成来自客户的写入并将数据保存在内存中。它可以在自己的时间刷新到磁盘。
<?xml version = .....
<beans ....
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="marshaller">
<bean class="org.apache.ignite.internal.binary.BinaryMarshaller" />
</property>
<property name="failureDetectionTimeout" value="10000" />
<property name="clientFailureDetectionTimeout" value="10000" />
<property name="peerClassLoadingEnabled" value="true" />
<property name="metricsLogFrequency" value="#{120*1000}"/>
<property name="atomicConfiguration">
<bean class="org.apache.ignite.configuration.AtomicConfiguration">
<property name="backups" value="1" />
</bean>
</property>
<property name="fileSystemConfiguration" >
<list>
<bean class="org.apache.ignite.configuration.FileSystemConfiguration">
<property name="name" value="igfs" />
<property name="blockSize" value="262144" />
<property name="bufferSize" value="262144" />
<property name="defaultMode" value="DUAL_ASYNC" />
<property name="dataCacheConfiguration" >
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="onheapCacheEnabled" value="true" />
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxMemorySize" value="#{10L * 1024 * 1024 * 1024}" />
</bean>
</property>
<property name="eagerTtl" value="true" />
<property name="expiryPolicyFactory">
<bean class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf"?
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="HOURS"/>
<constructor-arg value="15"/>
</bean>
</constructor-arg>
</bean>
</property>
<property name="atomicityMode" value="ATOMIC" />
<property name="statisticsEnabled" value="true" />
</bean>
</property>
</bean>
</list>
</property>
<property name="communicationSpi">
<bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
<property name="messageQueueLimit" value="500"
</bean>
</property>
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
<list>
<value>IP:47500..47509</value>
<value>IP:47500..47509</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="dataRegionConfigurations">
<list>
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="name" value="igfs" />
<property name="persistenceEnabled" value="true" />
<property name="metricsEnabled" value="true" />
<property name="maxSize" value="#{35: * 1024 * 1024 * 1024}" />
</bean>
</list>
</property>
<property name="defaultDataRegionConfiguration">
<property name="persistenceEnabled" value="true" />
<property name="metricsEnabled" value="true" />
<property name="maxSize" value="#{35: * 1024 * 1024 * 1024}" />
</property>
<property name="systemRegionMaxSize" value="#{6L * 1024 * 1024 * 1024}" />
</bean>
</property>
</bean>
结束
默认情况下,备份是异步发生的。您需要在 CacheConfiguration
上将 writeSynchronizationMode
指定为 SYNC
以使其成为其他方式。
在您的案例中最大的加速应该是在您的 DataStorageConfiguration
上将 walMode
设置为 LOG_ONLY
。
我正在水平扩展时调整我的 ignite 集群的性能。我的用例是保存到 IGFS 中的文件。中值大小约为 2 M,最大大小为 120G,95% 约为 1 G。严重偏向于更小的大小。
我的模型是丢失数据是可以的,因为每条数据都可以在性能下降的情况下恢复。但是,如果成员出现故障,我不想让我的 ignite 集群损坏,因为重新获取所有数据对我的用户(以及我自己)来说将是非常糟糕的一天。
另一方面,我希望保存速度尽可能快。因此,我采用的方法是,驱逐数据是可以的,并且在一些节点出现故障时丢失一些数据也可以,只要我在中断中丢失的数据不超过 10%。
我有一个名为 "igfs" 的 FileSystemConfiguration,我希望它延迟保存到也名为 "igfs" 的 DataStorageConfiguration。
为了有一些冗余,我将 ignite 设置为使用 IgniteConfiguration.AtomicConfiguration.backup = 1 的 1 个备份。我认为这意味着 ignite 中的每个条目都会写入一个副本。但是,我希望备份异步发生。我找不到对 IGFS 条目执行此操作的方法。有办法吗?
此外,是否有办法将 igfs 设置为延迟写入默认持久层(基于磁盘)?我真的很想完成来自客户的写入并将数据保存在内存中。它可以在自己的时间刷新到磁盘。
<?xml version = .....
<beans ....
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="marshaller">
<bean class="org.apache.ignite.internal.binary.BinaryMarshaller" />
</property>
<property name="failureDetectionTimeout" value="10000" />
<property name="clientFailureDetectionTimeout" value="10000" />
<property name="peerClassLoadingEnabled" value="true" />
<property name="metricsLogFrequency" value="#{120*1000}"/>
<property name="atomicConfiguration">
<bean class="org.apache.ignite.configuration.AtomicConfiguration">
<property name="backups" value="1" />
</bean>
</property>
<property name="fileSystemConfiguration" >
<list>
<bean class="org.apache.ignite.configuration.FileSystemConfiguration">
<property name="name" value="igfs" />
<property name="blockSize" value="262144" />
<property name="bufferSize" value="262144" />
<property name="defaultMode" value="DUAL_ASYNC" />
<property name="dataCacheConfiguration" >
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="onheapCacheEnabled" value="true" />
<property name="evictionPolicy">
<bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
<property name="maxMemorySize" value="#{10L * 1024 * 1024 * 1024}" />
</bean>
</property>
<property name="eagerTtl" value="true" />
<property name="expiryPolicyFactory">
<bean class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf"?
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="HOURS"/>
<constructor-arg value="15"/>
</bean>
</constructor-arg>
</bean>
</property>
<property name="atomicityMode" value="ATOMIC" />
<property name="statisticsEnabled" value="true" />
</bean>
</property>
</bean>
</list>
</property>
<property name="communicationSpi">
<bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
<property name="messageQueueLimit" value="500"
</bean>
</property>
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
<list>
<value>IP:47500..47509</value>
<value>IP:47500..47509</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="dataRegionConfigurations">
<list>
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="name" value="igfs" />
<property name="persistenceEnabled" value="true" />
<property name="metricsEnabled" value="true" />
<property name="maxSize" value="#{35: * 1024 * 1024 * 1024}" />
</bean>
</list>
</property>
<property name="defaultDataRegionConfiguration">
<property name="persistenceEnabled" value="true" />
<property name="metricsEnabled" value="true" />
<property name="maxSize" value="#{35: * 1024 * 1024 * 1024}" />
</property>
<property name="systemRegionMaxSize" value="#{6L * 1024 * 1024 * 1024}" />
</bean>
</property>
</bean>
结束
默认情况下,备份是异步发生的。您需要在 CacheConfiguration
上将 writeSynchronizationMode
指定为 SYNC
以使其成为其他方式。
在您的案例中最大的加速应该是在您的 DataStorageConfiguration
上将 walMode
设置为 LOG_ONLY
。