Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-1030

Drivers should check out an implicit session only after checking out a connection

    XMLWordPrintableJSON

Details

    • Spec Change
    • Status: Implementing
    • Major - P3
    • Resolution: Unresolved
    • None
    • Sessions
    • None
    • Needed
    • Hide

      Drivers need to implement a new prose test, and implement either a refactor of their sessions allocation to occur after connection checkout or lazily allocate an existing session after successful checkout.

      Show
      Drivers need to implement a new prose test, and implement either a refactor of their sessions allocation to occur after connection checkout or lazily allocate an existing session after successful checkout.

    Description

      Problem:
      When the number of concurrent application requests are larger than the number of available connections, the driver may generate many more implicit sessions than connections. For example with maxPoolSize=1 and 100 threads, 100 implicit sessions may be created. This increases the load on the server since session state is cached in memory. In the worst case this kind of workload can hit the session limit and trigger TooManyLogicalSessions.

      Proposed solution:
      Drivers should check out an implicit session only after checking out a connection. This change will limit the number of implicit sessions to no greater than an application's maxPoolSize (ignoring operations that hold on to the session like cursors).

      This change would not have any effect on explicit sessions created with startSession.

      Attachments

        Issue Links

          Activity

            People

              neal.beeken@mongodb.com Neal Beeken
              esha.bhargava@mongodb.com Esha Bhargava
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: