[CSHARP-3163] Performance degradation when using mongodb+srv Created: 15/Jul/20  Updated: 27/Oct/23  Resolved: 22/Jul/20

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Andrei Stryia Assignee: Dmitry Lukyanov (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File cpu.png    
Case:

 Description   

We recently switched our applications from using mongbd schema to the mongodb+srv and noticed significant performance degradation.

Simple performance test shows the following:
8 threads, 400 iterations
mongodb+srv :

44.8375ms connect time
    44.625ms get client time
    0.045ms get database time
    0.1ms get collection time
29.5575ms request execution time

mongodb:

3.7175ms connect time
    3.5325ms get client time
    0.01ms get database time
    0.16ms get collection time
23.8675ms request execution time

We are creating new instance of MongoClient for each request and the majority of time is spend on the client creation.

VS profiler shows that almost all time was spend on DnsClient.LookupClient constructor



 Comments   
Comment by Jeffrey Yemin [ 21/Jul/20 ]

andrei_stryia@epam.com

The 2.11.0 release is imminent, but we can't give you an exact date. If you have a support contract, please open a ticket in our Support portal and we may be able to provide more guidance in that context.

Regards,
Jeff

Comment by Andrei Stryia [ 16/Jul/20 ]

dmitry.lukyanov can you please advice when 2.11.0 expected to be released?
Or probably it's possible to receive fix as 2.10.5. The problem is really critical for us.

Comment by Andrei Stryia [ 15/Jul/20 ]

Looks like the problem is resolved in 2.11.0-beta2, the same perf test gives me significantly better results

2.439ms connect time
    2.087ms get client time
    0.08ms get database time
    0.262ms get collection time
18.787ms request execution time

Comment by Andrei Stryia [ 15/Jul/20 ]

Hello,

I'm on 2.10.3 right now.
I can check if the 2.11.0-beta2 fix the issue but I don't want to switch production setup to the package in beta.

Comment by Dmitry Lukyanov (Inactive) [ 15/Jul/20 ]

Hello andrei_stryia@epam.com ,

can you please mention what driver version do you use?

It looks like this behavior was improved in this ticket: https://jira.mongodb.org/browse/CSHARP-3038. This ticket was released in 2.11.0-beta2. If you use another driver version, can you please update your driver and check this issue again?

Generated at Wed Feb 07 21:44:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.