<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 閱讀(735) 評論(0)  編輯  收藏 所屬分類: Open source
    <2025年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    常用鏈接

    留言簿(10)

    隨筆檔案

    文章分類

    文章檔案

    相冊

    收藏夾

    java

    搜索

    •  

    最新評論


    主站蜘蛛池模板: 成人福利免费视频| 99re6在线视频精品免费下载| 日韩高清在线免费观看| 中文字幕亚洲码在线| 成人片黄网站A毛片免费| 国产午夜亚洲精品| 精品剧情v国产在免费线观看| 亚洲AV无码乱码在线观看代蜜桃 | 成人影片麻豆国产影片免费观看| 亚洲一级在线观看| 女人被免费视频网站| 亚洲欧美在线x视频| 亚洲七七久久精品中文国产| 国产精品免费看久久久香蕉| 亚洲精品成人片在线播放| 免费黄色电影在线观看| 亚洲熟妇色自偷自拍另类| 免费a级毛片无码a∨蜜芽试看| 亚洲gay片在线gv网站| 亚洲日韩精品无码专区网站| 成人影片一区免费观看| 亚洲熟妇色自偷自拍另类| 日本免费人成黄页网观看视频| 暖暖免费中文在线日本 | 亚洲欧洲高清有无| 免费被黄网站在观看| 一级女性全黄久久生活片免费 | 亚洲AV永久纯肉无码精品动漫| 亚洲精品视频在线观看免费| 91在线亚洲综合在线| 亚洲精品国产福利一二区| 无码精品人妻一区二区三区免费看| 亚洲AV无码乱码在线观看代蜜桃 | 无码一区二区三区AV免费| 亚洲AV无码专区在线厂| 亚洲AV无码成人专区片在线观看| 在线观看视频免费国语| 免费看少妇高潮成人片| 在线综合亚洲欧洲综合网站| 国产亚洲视频在线播放| 国产1024精品视频专区免费|