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

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.6.2
    • 3.6.3
    • 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

        1. index.js
          0.8 kB
          Yannick Haser

        Issue Links

          Activity

            People

              matt.broadstone@mongodb.com Matt Broadstone
              haser@videmo.de Yannick Haser
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: