Please forgive my long email I was not sure if the mailing list
supported attachments, since when I go to the archive I do not see any
attachments.
I am sure I am doing something wrong, but I sure can not figure out what
it is.
First off I built the latest tagged tree I could find JCS_1_2_6_5 and
then built the project using Maven 1.0.2.
I then created my own version of the Book example to see how well the
cache system performed using a remote cache.
Here is my ccf file:
------------------------------------------------------------------------------------------------------------------------
# Registry used to register and provide the IRmiCacheService service.
registry.host=localhost
registry.port=11101
# call back port to local caches.
remote.cache.service.port=11101
# cluster setting
remote.cluster.LocalClusterConsistency=true
# DEFAULT CACHE REGION
# sets the default aux value for any non configured caches
jcs.default=RFailover
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLifeSeconds=3600
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true
# Regions preconfigured for caching
jcs.region.runCache=RFailover
jcs.region.runCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.runCache.cacheattributes.MaxObjects=550
jcs.region.runCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.runCache.elementattributes.IsEternal=false
jcs.region.runCache.elementattributes.MaxLifeSeconds=7200
jcs.region.runCache.elementattributes.IdleTime=1800
jcs.region.runCache.elementattributes.IsSpool=true
jcs.region.runCache.elementattributes.IsRemote=true
jcs.region.runCache.elementattributes.IsLateral=true
# Remote RMI Cache set up to failover
jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
jcs.auxiliary.RFailover.attributes.RemoteTypeName=LOCAL
jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:11101
jcs.auxiliary.RFailover.attributes.GetOnly=false
jcs.auxiliary.RFailover.attributes.RemoveUponRemotePut=true
------------------------------------------------------------------------------------------------------------------------
Note that the rmi cache service at the top only appears on the remote
server side.
Here is a copy of my log4j.xml
------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="false"
xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %-17c{2} - %m%n"/>
</layout>
</appender>
<root>
<priority value ="info" />
<appender-ref ref="stdout" />
</root>
</log4j:configuration>
------------------------------------------------------------------------------------------------------------------------
commons-logging.properties
------------------------------------------------------------------------------------------------------------------------
# Set the LogFactory Implementation
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
# Set the Log Implementation
# Log4j - config file: log4j.properties
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
------------------------------------------------------------------------------------------------------------------------
When I run the remote server by itself the CPU utilization is low. When
I bring up a client and put one thing in the cache, the client cpu goes
to 30% and the server is at 60% and they do not change.
Also when I run the server script like:
./startRemoteCache.sh /remote.cache.ccf 11101 I get port already in
use. So I started up the rmiregisrty on 11102.
stdout of the server side:
------------------------------------------------------------------------------------------------------------------------
./startRemoteCache.sh /remote.cache.ccf
Classpath =
.:./../conf:/usr/java/jcs/conf:/usr/java/jcs/conf/:./../lib/concurrent.jar:./../lib/commons-collections-3.1.jar:./../lib/commons-configuration-1.2.jar:./../lib/commons-lang-2.0.jar:./../lib/commons-logging-1.0.4.jar:./../lib/jcs-1.2.6.jar:./../lib/NaracFWX.jar:./../lib/log4j-1.2.8.jar
Not starting registry, since no port was supplied.
-Xms128m -Xmx512m -Djava.security.policy=./../conf/cache.policy
2006-01-11 15:14:38,265 INFO server.RemoteCacheServerFactory -
ConfigFileName = [/remote.cache.ccf]
2006-01-11 15:14:38,456 INFO control.CompositeCacheConfigurator -
setting defaults to RFailover
2006-01-11 15:14:38,466 INFO control.CompositeCacheConfigurator -
setting defaultCompositeCacheAttributes to [ useLateral = true,
useRemote = true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1 ]
2006-01-11 15:14:38,466 WARN config.OptionConverter - Could not find
value for key jcs.default.elementattributes
2006-01-11 15:14:38,467 WARN control.CompositeCacheConfigurator - Could
not instantiate eAttr named 'jcs.default.elementattributes', using defaults.
2006-01-11 15:14:38,477 INFO control.CompositeCacheConfigurator -
setting defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL =
true, IS_REMOTE = true, IS_ETERNAL = false, MaxLifeSeconds = 3600,
IdleTime = 1800, CreateTime = 1137021278467, LastAccessTime =
1137021278467, getTimeToLiveSeconds() = 3599, createTime = 1137021278467 ]
2006-01-11 15:14:38,478 WARN config.OptionConverter - Could not find
value for key jcs.region.runCache.elementattributes
2006-01-11 15:14:38,478 WARN control.CompositeCacheConfigurator - Could
not instantiate eAttr named 'jcs.region.runCache.elementattributes',
using defaults.
2006-01-11 15:14:38,595 INFO lru.LRUMemoryCache - initialized
LRUMemoryCache for runCache
2006-01-11 15:14:38,595 INFO control.CompositeCache - Constructed cache
with name: runCache
2006-01-11 15:14:38,752 ERROR remote.RemoteCacheManager -
org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService
2006-01-11 15:14:38,872 INFO engine.CacheEventQueue - Destroy was
called after queue was destroyed. Doing nothing. Stats = Cache Event
Queue
Working = true
Alive = false
Empty = true
Size = 0
2006-01-11 15:15:08,854 INFO remote.RemoteCacheRestore - looking up
server
//localhost:11101/org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService
2006-01-11 15:15:08,864 INFO remote.RemoteCacheRestore - looking up
server
//localhost:11101/org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService
2006-01-11 15:15:08,942 INFO server.RemoteCacheServer - adding vm
listener under new id = 1
RemoteCacheServer:adding vm listener under new id = 1 >RMI TCP
Connection(4)-128.115.51.65
2006-01-11 15:15:08,944 INFO engine.CacheEventQueue - Destroy was
called after queue was destroyed. Doing nothing. Stats = Cache Event
Queue
Working = true
Alive = false
Empty = true
Size = 0
2006-01-11 15:15:08,944 INFO remote.RemoteCacheRestore - Remote
connection to
//localhost:11101/org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService
resumed.
2006-01-11 15:17:30,907 INFO server.RemoteCacheServer - adding vm
listener under new id = 2
RemoteCacheServer:adding vm listener under new id = 2 >RMI TCP
Connection(7)-128.115.51.65
2006-01-11 15:17:32,054 INFO engine.CacheEventQueue - Cache event queue
created: CacheEventQueue [listenerId=1, cacheName=runCache]
2006-01-11 15:17:32,055 INFO engine.CacheEventQueue - Cache event queue
created: CacheEventQueue [listenerId=1, cacheName=runCache]
2006-01-11 15:17:32,123 INFO engine.CacheEventQueue - Cache event queue
created: CacheEventQueue [listenerId=2, cacheName=runCache]
2006-01-11 15:17:42,152 INFO engine.CacheEventQueue - QProcessor
exiting for CacheEventQueue [listenerId=1, cacheName=runCache]
------------------------------------------------------------------------------------------------------------------------
stdout on the client side:
Cache test Menu:
-------------------------------------------
1) Test cache speed
2) Get cache statistics
3) update cache entry
4) Read cache entry
quit (exit)
-------------------------------------------
choice: 4
Jan 11, 2006 3:17:30 PM
org.apache.jcs.engine.control.CompositeCacheConfigurator setDefaultAuxValues
INFO: setting defaults to RFailover
Jan 11, 2006 3:17:30 PM
org.apache.jcs.engine.control.CompositeCacheConfigurator
setDefaultCompositeCacheAttributes
INFO: setting defaultCompositeCacheAttributes to [ useLateral = true,
useRemote = true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1 ]
Jan 11, 2006 3:17:30 PM org.apache.jcs.config.OptionConverter
instantiateByKey
WARNING: Could not find value for key jcs.default.elementattributes
Jan 11, 2006 3:17:30 PM
org.apache.jcs.engine.control.CompositeCacheConfigurator
parseElementAttributes
WARNING: Could not instantiate eAttr named
'jcs.default.elementattributes', using defaults.
Jan 11, 2006 3:17:30 PM
org.apache.jcs.engine.control.CompositeCacheConfigurator
setDefaultElementAttributes
INFO: setting defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL
= true, IS_REMOTE = true, IS_ETERNAL = false, MaxLifeSeconds = 3600,
IdleTime = 1800, CreateTime = 1137021450377, LastAccessTime =
1137021450377, getTimeToLiveSeconds() = 3599, createTime = 1137021450377 ]
Jan 11, 2006 3:17:30 PM org.apache.jcs.config.OptionConverter
instantiateByKey
WARNING: Could not find value for key jcs.region.runCache.elementattributes
Jan 11, 2006 3:17:30 PM
org.apache.jcs.engine.control.CompositeCacheConfigurator
parseElementAttributes
WARNING: Could not instantiate eAttr named
'jcs.region.runCache.elementattributes', using defaults.
Jan 11, 2006 3:17:30 PM org.apache.jcs.engine.memory.lru.LRUMemoryCache
initialize
INFO: initialized LRUMemoryCache for runCache
Jan 11, 2006 3:17:30 PM org.apache.jcs.engine.control.CompositeCache <init>
INFO: Constructed cache with name: runCache
2006-01-11 15:17:30,940 gov.llnl.narac.cachetest.RunManager.loadRun
INFO: Loading the run from DB
Jan 11, 2006 3:17:31 PM org.apache.jcs.engine.CacheEventQueue put
INFO: Cache event queue created: CacheEventQueue [listenerId=2,
cacheName=runCache]
2006-01-11 15:17:31,599 gov.llnl.narac.cachetest.RunManager.loadRun
INFO: Putting loaded run into cache
2006-01-11 15:17:31,604 gov.llnl.narac.cachetest.RunManager.loadRun
INFO: Done Loading the run
Runs name is: Run Name updated at: Wed Jan 11 09:41:11 PST 2006
Cache test Menu:
-------------------------------------------
1) Test cache speed
2) Get cache statistics
3) update cache entry
4) Read cache entry
quit (exit)
-------------------------------------------
choice: Jan 11, 2006 3:17:42 PM
org.apache.jcs.engine.CacheEventQueue$QProcessor run
INFO: QProcessor exiting for CacheEventQueue [listenerId=2,
cacheName=runCache]
If one client performs a cache update, the second client sees it Yeah!!
But if both perform updates, sometimes the reads get the latest value
from the cache, and sometimes the cache returns an older value??? This
does not make any sense to me.
Anyone have any idea what I might be doing wrong?
Thanks for any help,
Bill Eme
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]