commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Marc Spaggiari <jean-m...@spaggiari.org>
Subject Re: JCS Lateral Cache
Date Fri, 08 Feb 2013 13:06:45 GMT
Hi Thomas,

Thanks for jumping in.

Here is how I setup the cache:
			Properties props = new Properties();
			//# DEFAULT CACHE REGION
			//# sets the default aux value for any non configured caches
			props.put("jcs.default", "");
			props.put("jcs.default.cacheattributes",
"org.apache.jcs.engine.CompositeCacheAttributes");
			props.put("jcs.default.cacheattributes.MaxObjects", "10000");
			props.put("jcs.default.cacheattributes.MemoryCacheName",
"org.apache.jcs.engine.memory.lru.LRUMemoryCache");
			props.put("jcs.default.elementattributes.IsEternal", "false");
			props.put("jcs.default.elementattributes.MaxLifeSeconds", "86400");
			props.put("jcs.default.elementattributes.IdleTime", "1800");
			//# CACHE REGIONS AVAILABLE
			//# Regions preconfigured for caching
			props.put("jcs.region.robotCache", "DC, LTCP");
			props.put("jcs.region.robotCache.cacheattributes",
"org.apache.jcs.engine.CompositeCacheAttributes");
			props.put("jcs.region.robotCache.cacheattributes.MaxObjects", "131072");
			props.put("jcs.region.robotCache.cacheattributes.MemoryCacheName",
"org.apache.jcs.engine.memory.lru.LRUMemoryCache");
			props.put("jcs.region.robotCache.cacheattributes.UseMemoryShrinker", "true");
			props.put("jcs.region.robotCache.elementattributes.IsEternal", "false");
			props.put("jcs.region.robotCache.elementattributes.MaxLifeSeconds",
"604800");
			props.put("jcs.region.robotCache.elementattributes.IdleTime", "1800");
			props.put("jcs.region.robotCache.elementattributes.IsSpool", "true");
			props.put("jcs.region.robotCache.elementattributes.IsRemote", "false");
			props.put("jcs.region.robotCache.elementattributes.IsLateral", "true");
			//# AUXILIARY CACHES AVAILABLE
			//# Primary Disk Cache -- faster than the rest because of memory key storage
			props.put("jcs.auxiliary.DC",
"org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory");
			props.put("jcs.auxiliary.DC.attributes",
"org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes");
			props.put("jcs.auxiliary.DC.attributes.DiskPath", "robotCache");
			props.put("jcs.auxiliary.DC.attributes.MaxPurgatorySize", "131072");
			props.put("jcs.auxiliary.DC.attributes.MaxKeySize", "131072");
			props.put("jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount", "32768");
			props.put("jcs.auxiliary.DC.attributes.MaxRecycleBinSize", "32768");
			props.put("jcs.auxiliary.DC.attributes.OptimizeOnShutdown", "true");

			props.put("jcs.auxiliary.LTCP",
"org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory");
			props.put("jcs.auxiliary.LTCP.attributes",
"org.apache.jcs.auxiliary.lateral.socket.tcp.TCPLateralCacheAttributes");
			props.put("jcs.auxiliary.LTCP.attributes.TcpListenerPort", "1110");
			props.put("jcs.auxiliary.LTCP.attributes.AllowGet", "true");
			props.put("jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr", "224.168.23.0");
			props.put("jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort", "6780");
			props.put("jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled", "true");


			CompositeCacheManager.getUnconfiguredInstance().configure(props);


When I stop one of the servers, I'm getting this on all the others:

2013-02-08 07:41:27,243 [CacheEventQueue.QProcessor-robotCache] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPSender -
Detected problem with connection: java.net.SocketException: Software
caused connection abort: socket write error
2013-02-08 07:41:27,244 [CacheEventQueue.QProcessor-robotCache] ERROR
org.apache.jcs.auxiliary.lateral.LateralCache - Disabling lateral
cache due to error Failed to put
[E23498752609834581] to robotCache
java.net.SocketException: Software caused connection abort: socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
	at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
	at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1847)
	at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1756)
	at java.io.ObjectOutputStream.writeNonProxyDesc(ObjectOutputStream.java:1257)
	at java.io.ObjectOutputStream.writeClassDesc(ObjectOutputStream.java:1211)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1395)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
	at java.io.ObjectOutputStream.writeFatalException(ObjectOutputStream.java:1547)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:333)
	at org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPSender.send(LateralTCPSender.java:222)
	at org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService.update(LateralTCPService.java:127)
	at org.apache.jcs.auxiliary.lateral.LateralCache.update(LateralCache.java:100)
	at org.apache.jcs.engine.CacheAdaptor.handlePut(CacheAdaptor.java:91)
	at org.apache.jcs.engine.CacheEventQueue$PutEvent.doRun(CacheEventQueue.java:688)
	at org.apache.jcs.engine.CacheEventQueue$AbstractCacheEvent.run(CacheEventQueue.java:607)
	at org.apache.jcs.engine.CacheEventQueue$QProcessor.run(CacheEventQueue.java:575)
2013-02-08 07:41:28,277 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService - Could
not create sender to [192.168.23.4:1110] -- Socket is null, cannot
connect to 192.168.23.4:1110
2013-02-08 07:41:28,277 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager -
Can't fix Socket is null, cannot connect to 192.168.23.4:1110
2013-02-08 07:41:28,278 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.LateralCacheRestore - Can't fix Can't
fix Socket is null, cannot connect to 192.168.23.4:1110
2013-02-08 07:41:49,288 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService - Could
not create sender to [192.168.23.4:1110] -- Socket is null, cannot
connect to 192.168.23.4:1110
2013-02-08 07:41:49,288 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager -
Can't fix Socket is null, cannot connect to 192.168.23.4:1110
2013-02-08 07:41:49,288 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.LateralCacheRestore - Can't fix Can't
fix Socket is null, cannot connect to 192.168.23.4:1110
2013-02-08 07:42:10,389 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService - Could
not create sender to [192.168.23.4:1110] -- Socket is null, cannot
connect to 192.168.23.4:1110
2013-02-08 07:42:10,390 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager -
Can't fix Socket is null, cannot connect to 192.168.23.4:1110
2013-02-08 07:42:10,390 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.LateralCacheRestore - Can't fix Can't
fix Socket is null, cannot connect to 192.168.23.4:1110
2013-02-08 07:42:31,477 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService - Could
not create sender to [192.168.23.4:1110] -- Socket is null, cannot
connect to 192.168.23.4:1110
2013-02-08 07:42:31,477 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheManager -
Can't fix Socket is null, cannot connect to 192.168.23.4:1110
2013-02-08 07:42:31,478 [Thread-11] ERROR
org.apache.jcs.auxiliary.lateral.LateralCacheRestore - Can't fix Can't
fix Socket is null, cannot connect to 192.168.23.4:1110

And the last lines are displayed every 20 seconds... I can adjust the
loglevel to not display that, but if I do so I will miss the other
errors.


Here is the cache stats from one of the servers:

HitCountRam = 76351
HitCountAux = 0
---------------------------LRU Memory Cache
List Size = 15035
Map Size = 15035
Put Count = 16152
Hit Count = 76351
Miss Count = 1674
---------------------------Indexed Disk Cache
Is Alive = true
Key Map Size = 11988
Data File Length = 24953700
Hit Count = 460
Bytes Free = 3434776
Optimize Operation Count = 1313
Times Optimized = 0
Recycle Count = 0
Recycle Bin Size = 1312
Startup Size = 13300
Purgatory Hits = 0
Purgatory Size = 0
Working = true
Alive = false
Empty = true
Size = 0
---------------------------Lateral Cache No Wait Facade
Number of No Waits = 4
Working = true
Alive = true
Empty = true
Size = 0
Get Count = 1214
Remove Count = 460
Put Count = 1606
Working = true
Alive = true
Empty = true
Size = 0
Get Count = 0
Remove Count = 460
Put Count = 1606
Working = true
Alive = true
Empty = true
Size = 0
Get Count = 0
Remove Count = 460
Put Count = 1606
Working = true
Alive = true
Empty = true
Size = 0
Get Count = 0
Remove Count = 287
Put Count = 1374

######################################################

And here is for another one:

HitCountRam = 89305
HitCountAux = 0
---------------------------LRU Memory Cache
List Size = 14203
Map Size = 14203
Put Count = 15110
Hit Count = 89305
Miss Count = 2561
---------------------------Indexed Disk Cache
Is Alive = true
Key Map Size = 20761
Data File Length = 50181144
Hit Count = 1028
Bytes Free = 7610240
Optimize Operation Count = 2075
Times Optimized = 0
Recycle Count = 0
Recycle Bin Size = 2074
Startup Size = 22835
Purgatory Hits = 0
Purgatory Size = 0
Working = true
Alive = false
Empty = true
Size = 0
---------------------------Lateral Cache No Wait Facade
Number of No Waits = 4
Working = true
Alive = true
Empty = true
Size = 0
Get Count = 1533
Remove Count = 1028
Put Count = 2469
Working = true
Alive = true
Empty = true
Size = 0
Get Count = 0
Remove Count = 1028
Put Count = 2469
Working = true
Alive = true
Empty = true
Size = 0
Get Count = 0
Remove Count = 1028
Put Count = 2469
Working = true
Alive = true
Empty = true
Size = 0
Get Count = 0
Remove Count = 1028
Put Count = 2469

As you can see, the map sizes are very different on the 2 servers when
I will have expected hem to be pretty identicals... and it's the same
on all the servers. all have different map size.

So I'm wondering if the lateral cache is really used. I will say yes
because I'm getting the exceptions when one server is going down, but
I'm not seeing the benefits yet.

I'm using JCS 1.3.

Thanks,

JM

PS: If it's not readable, I can paste the logs on PasteBin...

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message