Session management. Horse races

Just raw results without explanation…

Horses: Session, SessionI, SessionII, SessionIII, SessionIV, SessionV, SessionVI, SessionVII, DarkHorse – implement different patterns to acquire DFC-session

DFC Settings:

  • default – means default settings
  • reuse_limit – dfc.session.reuse_limit = 2147483647
  • global_pool – dfc.session.global_pool_enabled=true
  • old pool – dfc.compatibility.useD7SessionPooling=false

Results: DFC benchmark

Preview:



DNF (did not finish) means enabling global pool causes thread-safety issues like:

java.util.NoSuchElementException
        at java.util.LinkedList.getFirst(LinkedList.java:109)
        at com.documentum.fc.client.impl.session.GlobalSessionPool.get(GlobalSessionPool.java:41)
        at com.documentum.fc.client.impl.session.PooledSessionFactory.newSession(PooledSessionFactory.java:33)
        at com.documentum.fc.client.impl.session.SessionManager.getSessionFromFactory(SessionManager.java:134)
        at com.documentum.fc.client.impl.session.SessionManager.newSession(SessionManager.java:72)
        at com.documentum.fc.client.impl.session.SessionManager.getSession(SessionManager.java:191)
        at tel.panfilov.documentum.benchmark.impl.Session.doOp(Session.java:31)
        at tel.panfilov.documentum.benchmark.impl.SessionI.doOp(SessionI.java:14)
        at tel.panfilov.documentum.benchmark.Benchmark.run(Benchmark.java:105)
        at java.lang.Thread.run(Thread.java:662)


java.util.ConcurrentModificationException
        at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
        at java.util.LinkedList$ListItr.remove(LinkedList.java:729)
        at com.documentum.fc.client.impl.session.GlobalSessionPool.flush(GlobalSessionPool.java:114)
        at com.documentum.fc.client.impl.session.PooledSessionFactory.flush(PooledSessionFactory.java:80)
        at com.documentum.fc.client.impl.session.SessionManager.flushSessions(SessionManager.java:259)
        at com.documentum.fc.client.impl.session.SessionManager.flushSessions(SessionManager.java:287)
        at tel.panfilov.documentum.benchmark.impl.SessionIII.doOp(SessionIII.java:15)
        at tel.panfilov.documentum.benchmark.Benchmark.run(Benchmark.java:105)
        at java.lang.Thread.run(Thread.java:662


Exception in thread "Global Session pool worker" java.util.ConcurrentModificationException
        at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
        at java.util.LinkedList$ListItr.next(LinkedList.java:696)
        at com.documentum.fc.client.impl.session.GlobalSessionPool.flushExpiredSessions(GlobalSessionPool.java:203)
        at com.documentum.fc.client.impl.session.GlobalSessionPool$ExpirationThread.run(GlobalSessionPool.java:232)

2 thoughts on “Session management. Horse races

  1. Hi Andrey,

    I just test your benchmark script using a 7.1DFC P02 (because it’s the one I have installed the machine where I’m working today).

    And I didn’t have any problem using global_pool and multi-threading I try 10 and 50 successfully, If you want I can send you my results.

    Like

  2. Pierre,
    nice catch! Unfortunately it’s hard to reproduce thread-safety issues because to deal with such mistakes we need to design another tests, and your statement does not prove anything – my tests were not designed to demonstrate thread-safety issues, but, fortunately, I caught some of them.

    GlobalSessionPool implementation:

    class GlobalSessionPool {
      private final m_mutex = new Object();
      private static Map<String, LinkedList<PoolEntry>> m_sessions = new HashMap();
    
      public ISession get(IDocbaseSpec docbasespec, IDfLoginInfo logininfo) {
        synchronized(m_mutex) {
           some m_sessions related logic
        }
      }
    
      public void put(ISession session) {
        synchronized(m_mutex) {
           some m_sessions related logic
        }  
      }
    
      // 6.7SP2 implementation, not implemented in 7.1
      public int flush(IDocbaseSpec docbaseSpec) {
        synchronized(this) {
           some m_sessions related logic
        }
      }
    
      static void flushExpiredSessions() {
        synchronized(SessionPool.class) {
           some m_sessions related logic
        }
      }
    
    }
    

    GlobalSessionPool.put() and GlobalSessionPool.get() are synchronized on the same monitor object, but GlobalSessionPool.flush() and GlobalSessionPool.flushExpiredSessions() use another monitors – this is obviously a bug. In my scenario calling IDfSessionManager.flushSessions() adds more concurrency in 6.7SP2 rather than in 7.1 due to missing implementation of GlobalSessionPool.flush() method in 7.1.

    But yeah, it’s worth to add 7.1 column in my results, I think I will update post soon.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s