`

JCS官方文档的简单笔记,仅供自己参考

 
阅读更多

1. 基本配置

jcs.default=DC
jcs.default.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000 (The maximum number of items allowed in memory)
jcs.default.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=true (内存清理,设为true时会扫描内存,删除过期的和空闲时间超期的item)
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 (specifies how long an object can be in memory before it is subjected to removal or being spooled to a disk cache if it is available,指定了在内存中的存活时间,超时的如果还available会被写入磁盘,只在设置了memory shrinker后有效)
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 (how often the shrinker should run,只在设置了memory shrinker后有效)

jcs.default.cacheattributes.DiskUsagePatternName=SWAP (SWAP, UPDATE, JDBC)
jcs.default.elementattributes=org.apache.commons.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false (是否永久有效)
jcs.default.elementattributes.MaxLifeSeconds=700 (the maximum life of an item,指定了生命周期,超时的item不能被get到,如果设置了MemoryShinker,则会被清理)
jcs.default.elementattributes.IdleTime=1800 (the maximum time an item can live without being accessed,指定了item的最长空闲时间)
jcs.default.elementattributes.IsSpool=true (是否写入磁盘)
jcs.default.elementattributes.IsRemote=true (是否发送给远程服务器)
jcs.default.elementattributes.IsLateral=true (是否并行分布)

 

2. LTCP

jcs.auxiliary.LTCP=org.apache.commons.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory
jcs.auxiliary.LTCP.attributes=org.apache.commons.jcs.auxiliary.lateral.socket.tcp.TCPLateralCacheAttributes
#jcs.auxiliary.LTCP.attributes.TcpServers=localhost:1111,localhost:1112 (
This is the list of servers this cache should try to connect to. With UDP discovery this is not necessary)
jcs.auxiliary.LTCP.attributes.TcpListenerPort=1118 (本地cache监听的端口)
jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.8 (并行cache的ip)
jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780 (并行cache的udp端口)
jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true (
UDP discovery是否开启)
jcs.auxiliary.LTCP.attributes.Receive=true (false时只发送数据,true时接收并行cache发送的数据)
jcs.auxiliary.LTCP.attributes.AllowGet=false (是否允许本地cache从并行cache那里get,被
PutOnlyMode属性控制)
jcs.auxiliary.LTCP.attributes.IssueRemoveOnPut=false (ture时,用remove代替put,数据一致性更强些)
jcs.auxiliary.LTCP.attributes.FilterRemoveByHashCode=false (
If this is true, and IssueRemoveOnPut is true, the client will include the hashCode of the element to remove. If it is also true on the receiving end, the receiver will check to see if the element exists. If the element exists, and the hashCodes are the same, the item will not be removed)
jcs.auxiliary.LTCP.attributes.SocketTimeoOt=1001 (
socket (read) timeout)
jcs.auxiliary.LTCP.attributes.OpenTimeOut=2002 (
socket open timeout)
jcs.auxiliary.LTCP.attributes.ZombieQueueMaxSize=2000 (与并行cache连接异常时,未同步事件的列表长度)

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics