Ignite 点燃C++;客户端模式,近缓存
我有一个在复制模式下运行的ignite服务器,在同一个节点上有许多启用了近缓存的客户端。现在,当我使用近缓存和不使用近缓存运行客户机时,我没有发现有显著的性能差异 我对近缓存的理解是,经常使用的键和值将存储在客户机本身,因此不会对服务器进行实际的Get()调用。如果我错了,请纠正我 是否有人可以共享正在工作的近缓存配置xmlIgnite 点燃C++;客户端模式,近缓存,ignite,Ignite,我有一个在复制模式下运行的ignite服务器,在同一个节点上有许多启用了近缓存的客户端。现在,当我使用近缓存和不使用近缓存运行客户机时,我没有发现有显著的性能差异 我对近缓存的理解是,经常使用的键和值将存储在客户机本身,因此不会对服务器进行实际的Get()调用。如果我错了,请纠正我 是否有人可以共享正在工作的近缓存配置xml SERVER CONFIG: <beans xmlns="http://www.springframework.org/schema/beans" xm
SERVER CONFIG:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="cacheConfiguration">
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="cacheMode" value="LOCAL" />
<!-- Enable near cache to cache recently accessed data. -->
<!-- <property name="nearConfiguration">
<bean class="org.apache.ignite.configuration.NearCacheConfiguration"/>
</property> -->
<property name="nearConfiguration">
<bean class="org.apache.ignite.configuration.NearCacheConfiguration">
</bean>
</property>
</bean>
</property>
<!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<!--
Ignite provides several options for automatic discovery that can be used
instead os static IP based discovery.
-->
<!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
<!-- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> -->
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
<!-- <value>127.0.0.1:48550..48551</value> -->
<value>XXX.ZZZ.yyy.36:47500..47501</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</beans>
CLIENT CONFIG:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="cacheConfiguration">
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="cacheMode" value="LOCAL" />
<!-- Enable near cache to cache recently accessed data. -->
<!-- <property name="nearConfiguration">
<bean class="org.apache.ignite.configuration.NearCacheConfiguration"/>
</property> -->
<property name="nearConfiguration">
<bean class="org.apache.ignite.configuration.NearCacheConfiguration">
</bean>
</property>
</bean>
</property>
<!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<!--
Ignite provides several options for automatic discovery that can be used
instead os static IP based discovery.
-->
<!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
<!-- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"> -->
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
<!-- <value>127.0.0.1:48550..48551</value> -->
<value>XXX.ZZZ.yyy.38:47500..47501</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</beans>
服务器配置:
三十、 ZZZ.yyy.36:47500..47501
客户端配置:
三十、 ZZZ.yyy.38:47500..47501
是的,near-cache通过在本地缓存节点上经常使用的条目来提高性能,但如果在单机或JVM上运行所有测试,这是没有意义的。近缓存允许不在远程节点上获取数据,但在您的测试中,一切都已在本地工作
此外,近缓存对复制的
或分区的
缓存上的服务器节点没有意义,其中备份的数量等于或大于数据节点的数量,因为每个节点的所有数据集都已在本地可用
所以,为了提高性能,当服务器节点在远程机器上工作时,您需要将客户端节点配置为使用近缓存。测量前,不要忘记在缓存附近预热
以下是用于设置近缓存的XML代码段:
...
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Your other cache config -->
<property name="nearConfiguration">
<bean class="org.apache.ignite.configuration.NearCacheConfiguration"/>
</property>
</bean>
...
。。。
...
我已经添加了使用过的配置,但是使用上面的配置,我可以看到ignitevisor关闭了近缓存。我想您看到的节点是错误的。它可能对服务器禁用,但对客户端启用。您好,谢谢,我可以看到我没有为每个缓存单独添加近缓存配置。现在我可以看到近缓存已启用。。