Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2750

High goroutine count in connection read/write

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Unknown Unknown
    • None
    • 1.9.1, 1.11.1
    • None
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      Summary

      Go application experiences behavior where the application runs okay for a while but then over time gradually begins to consume more CPU until 100% of 1 CPU is consumed and the application mostly stops responding.

      The application is reading messages from a collection via a tailable cursor.  As the application increases in CPU usage, the number of goroutines increase:

      go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*connection).write.func2 N=XX
      go.mongodb.org/mongo-driver/x/mongo/driver/topology.(*connection).read.func2 N=XX

      N starts out small - under 10 and then increases to over 700 for both write and read.  I have ran the command `db.currentOp(true)` on the Mongo server to ensure connections are not being leaked and most of the time the application only has 3-5 connections.

      The application is processing the messages one at a time so it should not require a large number of connections to Mongo.

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      Mongo version: 5.0.14

      Go version: 1.19.5

      Reproduced on mongo driver versions 1.9.1 and 1.11.1.

      How to Reproduce

      Do not have a reproducible test case outside of application.

      Additional Background

      If problem is in application code, need some guidance on what kind of application code would cause a very high number of connection read/write goroutines but a low number of database connections.

      Attachments

        Activity

          People

            qingyang.hu@mongodb.com Qingyang Hu
            luke.mauldin@l3harris.com Luke Mauldin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: