Coherence分布式缓存到期延迟

时间:2013-11-13 18:20:18

标签: caching oracle-coherence

我的coherence服务器有以下配置。什么是默认的到期延迟和驱逐政策?如何修改默认设置?

<cache-config>
    <caching-scheme-mapping>
        <cache-mapping>
            <cache-name>TEST_CACHE</cache-name>
            <scheme-name>distributed-extend</scheme-name>
        </cache-mapping>
    </caching-scheme-mapping>

    <caching-schemes>
        <distributed-scheme>
            <scheme-name>distributed-extend</scheme-name>
            <service-name>DistributedCache</service-name>
            <lease-granularity>member</lease-granularity>
            <backing-map-scheme>
                <local-scheme/>
            </backing-map-scheme>
            <autostart>true</autostart>
        </distributed-scheme>
        <proxy-scheme>
            <service-name>ExtendTcpProxyService</service-name>
            <thread-count>5</thread-count>
            <acceptor-config>
            <tcp-acceptor>
                <local-address>
                    <address>localhost</address>
                    <port>9098</port>
                </local-address>
            </tcp-acceptor>
            </acceptor-config>
            <autostart>true</autostart>
        </proxy-scheme>
    </caching-schemes>
</cache-config>

1 个答案:

答案 0 :(得分:1)

默认为永远,相当于

<expiry-delay>0</expiry-delay>

see local-scheme expiry-delay

随着过期,你最好设置优化条目驱逐。 see local-scheme flush-delay

在您的示例中,而不是<local-scheme/> 做点什么

<local-scheme>
  <expiry-delay>10d</expiry-delay>
  <flush-delay>1d</flush-delay>
</local-scheme>

这意味着连贯性将每天10天退出一次