<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>


    posts - 15,  comments - 34,  trackbacks - 27

    The following document illustrates several basic JCS configurations. As you'll see, using JCS can be as simple as creating a single memory cache for you application. However, with a few configuration changes, you can quickly enable some distributed caching features that can scale your application even further.

    Building a cache.ccf file

    Configuring the JCS can be as simple as your needs. The most basic configuration would be a pure memory cache where every region takes the default values. The complete configuration file (cache.ccf) could look like this:

    # DEFAULT CACHE REGION   

    jcs.
    default=
    jcs.
    default.cacheattributes=
        org.apache.jcs.engine.CompositeCacheAttributes
    jcs.
    default.cacheattributes.MaxObjects=1000
    jcs.
    default.cacheattributes.MemoryCacheName=
        org.apache.jcs.engine.memory.lru.LRUMemoryCache
            
    If you want to add memory shrinking then you can add these lines: 

    jcs.
    default.cacheattributes.cacheattributes.UseMemoryShrinker=true
    jcs.
    default.cacheattributes.cacheattributes.MaxMemoryIdleTimeSeconds=3600
    jcs.
    default.cacheattributes.cacheattributes.ShrinkerIntervalSeconds=60

    Adding a disk cache is as simple as telling it what folder to use. It is recommended that you add a disk cache. If you want to add a disk cache to your default parameters, then (1) add this to the bottom of the file to create the auxiliary:

    jcs.auxiliary.DC=
        org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
    jcs.auxiliary.DC.attributes
    =
        org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
    jcs.auxiliary.DC.attributes.DiskPath
    =g:/dev/jakarta-turbine-stratum/raf

    and (2) change the first line to:

    jcs.default=DC

    It is a good idea to specify the system.GroupIdCache, so add this to the file:

    jcs.system.groupIdCache=DC
    jcs.system.groupIdCache.cacheattributes
    =
        org.apache.jcs.engine.CompositeCacheAttributes
    jcs.system.groupIdCache.cacheattributes.MaxObjects
    =10000
    jcs.system.groupIdCache.cacheattributes.MemoryCacheName
    =
        org.apache.jcs.engine.memory.lru.LRUMemoryCache

    If you want to predefine a specific region, say called testCache1, then add these lines:

    jcs.region.testCache1=DC
    jcs.region.testCache1.cacheattributes
    =
        org.apache.jcs.engine.CompositeCacheAttributes
    jcs.region.testCache1.cacheattributes.MaxObjects
    =1000
    jcs.region.testCache1.cacheattributes.MemoryCacheName
    =
        org.apache.jcs.engine.memory.lru.LRUMemoryCache
    jcs.region.testCache1.cacheattributes.UseMemoryShrinker
    =true
    jcs.region.testCache1.cacheattributes.MaxMemoryIdleTimeSeconds
    =3600
    jcs.region.testCache1.cacheattributes.ShrinkerIntervalSeconds
    =60

    If you want to add a lateral cache for distribution (the TCP Lateral Auxiliary is recommended), then add these lines to the bottom of the file to define the auxiliary:

    jcs.auxiliary.LTCP=
        org.apache.jcs.auxiliary.lateral.LateralCacheFactory
    jcs.auxiliary.LTCP.attributes
    =
        org.apache.jcs.auxiliary.lateral.LateralCacheAttributes
    jcs.auxiliary.LTCP.attributes.TransmissionTypeName
    =TCP
    jcs.auxiliary.LTCP.attributes.TcpServers
    =localhost:1111
    jcs.auxiliary.LTCP.attributes.TcpListenerPort
    =1110
    jcs.auxiliary.LTCP.attributes.PutOnlyMode
    =false

    See the TCP Lateral documentation for more information. If you want to set up testCache1 to use this, then change the definition to:

    jcs.region.testCache1=DC,LTCP

    A few comments on configuration

    Auxiliary definitions are like log4j appenders, they are defines and then associated with a region like a log4j category.

    The order of configuration file is unimportant, though you should try to keep it organized for your own sake.

    Configuration is being refactored and is subject to change. It should only become easier.

    The complete file

    The complete file from above would look like this:

    # DEFAULT CACHE REGION   
    
    jcs.default=DC,LTCP
    jcs.default.cacheattributes=
        org.apache.jcs.engine.CompositeCacheAttributes
    jcs.default.cacheattributes.MaxObjects=1000
    jcs.default.cacheattributes.MemoryCacheName=
        org.apache.jcs.engine.memory.lru.LRUMemoryCache
    
    # System CACHE REGION   
    jcs.system.groupIdCache=DC,LTCP
    jcs.system.groupIdCache.cacheattributes=
        org.apache.jcs.engine.CompositeCacheAttributes
    jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
    jcs.system.groupIdCache.cacheattributes.MemoryCacheName=
        org.apache.jcs.engine.memory.lru.LRUMemoryCache
    
    # PRE-DEFINED CACHE REGIONS   
    
    jcs.region.testCache1=DC,LTCP
    jcs.region.testCache1.cacheattributes=
        org.apache.jcs.engine.CompositeCacheAttributes
    jcs.region.testCache1.cacheattributes.MaxObjects=1000
    jcs.region.testCache1.cacheattributes.MemoryCacheName=
        org.apache.jcs.engine.memory.lru.LRUMemoryCache
    jcs.region.testCache1.cacheattributes.UseMemoryShrinker=true
    jcs.region.testCache1.cacheattributes.MaxMemoryIdleTimeSeconds=3600
    jcs.region.testCache1.cacheattributes.ShrinkerIntervalSeconds=60
    
    # AVAILABLE AUXILIARY CACHES   
    jcs.auxiliary.DC=
        org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
    jcs.auxiliary.DC.attributes=
        org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
    jcs.auxiliary.DC.attributes.DiskPath=g:/dev/jakarta-turbine-stratum/raf
    jcs.auxiliary.DC.attributes.maxKeySize=100000
    
    jcs.auxiliary.LTCP=
        org.apache.jcs.auxiliary.lateral.LateralCacheFactory
    jcs.auxiliary.LTCP.attributes=
        org.apache.jcs.auxiliary.lateral.LateralCacheAttributes
    jcs.auxiliary.LTCP.attributes.TransmissionTypeName=TCP
    jcs.auxiliary.LTCP.attributes.TcpServers=localhost:1111
    jcs.auxiliary.LTCP.attributes.TcpListenerPort=1110
    jcs.auxiliary.LTCP.attributes.PutOnlyMode=false
    
    posted on 2005-02-04 11:21 jacky 閱讀(730) 評論(0)  編輯  收藏 所屬分類: Open source
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(10)

    隨筆檔案

    文章分類

    文章檔案

    相冊

    收藏夾

    java

    搜索

    •  

    最新評論


    主站蜘蛛池模板: 亚洲真人无码永久在线| 国产美女无遮挡免费视频网站| 亚洲精品亚洲人成在线观看下载| 亚洲性无码AV中文字幕| 久久电影网午夜鲁丝片免费| 亚洲性无码av在线| 亚洲天堂免费在线| 亚洲综合成人婷婷五月网址| 国内外成人免费视频| 亚洲av无码成人影院一区 | 亚洲高清资源在线观看| 99久久免费精品视频| 亚洲另类春色校园小说| 成人a视频片在线观看免费| 精品久久亚洲一级α| 精品国产日韩亚洲一区| 久久免费视频观看| 久久狠狠高潮亚洲精品| 希望影院高清免费观看视频| 亚洲精品9999久久久久无码| 亚洲av日韩av欧v在线天堂| baoyu122.永久免费视频| 亚洲日韩乱码久久久久久| 日韩免费观看的一级毛片| 久久久久女教师免费一区| 亚洲黄色三级网站| 国产女高清在线看免费观看| 精品国产污污免费网站入口在线| 亚洲AV人人澡人人爽人人夜夜| 久久午夜免费视频| 特级毛片全部免费播放| 久久青青成人亚洲精品| 毛片免费在线观看网址| 美女免费视频一区二区| 国产亚洲成av片在线观看| 日韩精品福利片午夜免费观着| 曰批全过程免费视频免费看 | a成人毛片免费观看| 亚洲精品福利网泷泽萝拉| 国产精品无码免费视频二三区| 久草免费福利在线|