gpt4 book ai didi

java - Ignite 配置 2.6-IGFS 速度——异步备份/磁盘写入?

转载 作者:行者123 更新时间:2023-12-02 10:01:10 35 4
gpt4 key购买 nike

我正在水平扩展时调整我的 ignite 集群的性能。我的用例是将文件保存到 IGFS 中。中值尺寸约为 2 M,最大尺寸为 120G,95 百分位数约为 1 G。严重偏向较小尺寸。

我的模型是,丢失数据是可以接受的,因为每条数据都可以在性能受到影响的情况下恢复。但是,如果成员出现故障,我不想让我的 ignite 集群损坏,因为重新获取所有数据对我的用户(以及我自己)来说将是非常糟糕的一天。

另一方面,我希望保存尽可能快。所以我采取的方法是,可以驱逐数据,如果一些节点出现故障,也可以丢失一些数据,只要我在中断中丢失的数据不超过 10%。

我有一个名为“igfs”的 FileSystemConfiguration,我希望它惰性保留到也名为“igfs”的 DataStorageConfiguration。

为了获得一些冗余,我将 ignite 设置为使用 1 个备份,其中 IgniteConfiguration.AtomicConfiguration.backup = 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

关于java - Ignite 配置 2.6-IGFS 速度——异步备份/磁盘写入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55619354/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com