Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2861

Performance Regression for usage of mongodb connections (queries, inserts, ...)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.2
    • Fix Version/s: 3.6.3
    • Component/s: None
    • Labels:
      None

      Description

      The fix for https://jira.mongodb.org/browse/NODE-2803 introduced a noticable performance regression for all mongodb connections (queries, inserts, ...).

      This performance hit is only visible, if the nodejs event loop is under pressure.

      In the example in the linked ticket nothing happens but mongodb insert logic. This results in an average iteration duration of the event loop of around 1ms.

      ==> the setImmediate usage results in a 1ms delay before sending the request to mongodb (compared to 3.6.1)

       

      But if the nodejs process (for example as a webserver) has multiple further things to do on the event loop (everything shortlived, fast, non blocking) this average iteration duration of the event loop can rise. For example to ~10ms.

      ==> the setImmediate usage results in a ~10ms delay before sending the request to mongodb (compared to 3.6.1) to get the next batch

       

      This small delay adds up, most noticable for queries with cursors and multiple getMore-Roundtrips to Mongodb.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              matt.broadstone Matt Broadstone
              Reporter:
              haser@videmo.de Yannick Haser
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: