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

Improve SetCompressors documentation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Security Level: Public
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change

      Description

      UPDATED DESCRIPTION:

      The SetCompressors documentation makes it seem like there is user action required to enable compression server-side, but this is not true because the server has compression enabled by default. There's some small docs changes we can make here to improve the wording.

       

      ORIGINAL DESCRIPTION:

      I just noticed that you can enable compression on connections. The docs make it appear as if this requires special server config to enable but `mongod` actually has all compressors enabled by default even though the older ones are prefferred over newer ones.

       

      I propose pending any potential perf or other issues related to the current implementation that we match the default server config and enable compressors by default. I think the tests might need to be changed to explicitly disable compression though. The readme says that is their default and I'm not sure how much they depend on that since they are testing driver code.

       

      ie change from empty slice to `[]string{"snappy","zstd","zlib"}`

       

      https://docs.mongodb.com/manual/reference/program/mongod/#cmdoption-mongod-networkmessagecompressors

       

      https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo/options?tab=doc#ClientOptions.SetCompressors

       

      Any thoughts on if this would break anything? I would think it'd be a good performance boost in most cases.

       

        Attachments

          Activity

            People

            Assignee:
            divjot.arora Divjot Arora
            Reporter:
            epelc@greatcloak.com Ed Pelc
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: