net.sf.ehcache.distribution.ManualRMICacheManagerPeerProvider

Terracotta Project Issue Tracker | Jon Christiansen | 7 years ago
  1. 0

    If using ManualRMICacheManager (when not using automatic/multicast discovery), I believe I'm hitting what appears to be a significant performance issue. I am also using the RMISynchronousCacheReplicator in this case. For every replicated cache change going through, the call goes through listRemoteCachePeers (which is synchronized) Every call to listRemoteCachePeers makes a call to lookupRemoteCachePeer, which will cause an outbound network connection to be made. Perhaps a separate thread similar to the heartbeat sender used for the MulticastRMICacheManagerPeerProvider could be employed to maintain a CopyOnWriteArrayList of peers rather than every single message needing replication doing an additional lookup to each peer node. I'm currently looking at Thread Dump Analyzer showing where I have 40 different threads all waiting on the thread below to get out of the sync block. -JC "httpSSLWorkerThread-8080-33" daemon prio=10 tid=0x00002aac546e6800 nid=0x3a60 runnable [0x000000004783d000..0x000000004783eb10] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read(BufferedInputStream.java:237) - locked <0x00002aaba059dce8> (a java.io.BufferedInputStream) at java.io.DataInputStream.readByte(DataInputStream.java:248) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:195) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359) at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at java.rmi.Naming.lookup(Naming.java:84) at net.sf.ehcache.distribution.RMICacheManagerPeerProvider.lookupRemoteCachePeer(RMICacheManagerPeerProvider.java:127) at net.sf.ehcache.distribution.ManualRMICacheManagerPeerProvider.listRemoteCachePeers(ManualRMICacheManagerPeerProvider.java:95) - locked <0x00002aaae6fe8270> (a net.sf.ehcache.distribution.ManualRMICacheManagerPeerProvider) at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.listRemoteCachePeers(RMISynchronousCacheReplicator.java:335) at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicateRemovalNotification(RMISynchronousCacheReplicator.java:239) at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementRemoved(RMISynchronousCacheReplicator.java:229) at net.sf.ehcache.event.RegisteredEventListeners.notifyElementRemoved(RegisteredEventListeners.java:77) at net.sf.ehcache.Cache.remove(Cache.java:1567) at net.sf.ehcache.Cache.remove(Cache.java:1463) at net.sf.ehcache.Cache.remove(Cache.java:1421) at net.sf.ehcache.constructs.blocking.BlockingCache.put(BlockingCache.java:507) at net.sf.ehcache.constructs.blocking.SelfPopulatingCache.get(SelfPopulatingCache.java:74) at net.sf.ehcache.constructs.blocking.BlockingCache.get(BlockingCache.java:563)

    Terracotta Project Issue Tracker | 7 years ago | Jon Christiansen
    net.sf.ehcache.distribution.ManualRMICacheManagerPeerProvider

    Root Cause Analysis

    1. net.sf.ehcache.distribution.ManualRMICacheManagerPeerProvider

      No message provided

      at net.sf.ehcache.distribution.RMISynchronousCacheReplicator.listRemoteCachePeers()
    2. Ehcache
      BlockingCache.get
      1. net.sf.ehcache.distribution.RMISynchronousCacheReplicator.listRemoteCachePeers(RMISynchronousCacheReplicator.java:335)
      2. net.sf.ehcache.distribution.RMISynchronousCacheReplicator.replicateRemovalNotification(RMISynchronousCacheReplicator.java:239)
      3. net.sf.ehcache.distribution.RMISynchronousCacheReplicator.notifyElementRemoved(RMISynchronousCacheReplicator.java:229)
      4. net.sf.ehcache.event.RegisteredEventListeners.notifyElementRemoved(RegisteredEventListeners.java:77)
      5. net.sf.ehcache.Cache.remove(Cache.java:1567)
      6. net.sf.ehcache.Cache.remove(Cache.java:1463)
      7. net.sf.ehcache.Cache.remove(Cache.java:1421)
      8. net.sf.ehcache.constructs.blocking.BlockingCache.put(BlockingCache.java:507)
      9. net.sf.ehcache.constructs.blocking.SelfPopulatingCache.get(SelfPopulatingCache.java:74)
      10. net.sf.ehcache.constructs.blocking.BlockingCache.get(BlockingCache.java:563)
      10 frames