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

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.3
    • Affects Version/s: 3.6.2
    • Component/s: None

      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.

       

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

              Created:
              Updated:
              Resolved: