[CSHARP-1717] The Aggregation Query is taking a long time to finish Created: 20/Jul/16 Updated: 16/Jun/20 Resolved: 16/Jun/20 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Performance |
| Affects Version/s: | 1.11 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Jawad Ahmed Khan | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng, question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
62 GB memory on the host, Linux 7.2, VM Host, 4 cpu |
||
| Description |
|
The Following Query is taking almost 5 - 10 minutes to execute when date range of 1 day is specified. The MongoDB has around 19,000 transactions per hour. Here is the MongoDB Query in C#
|
| Comments |
| Comment by Rachelle Palmer [ 16/Jun/20 ] |
|
For questions like this, we recommend reaching out to our support engineering team. They are able to provide in depth analysis of issues and fine-tune queries. Here are some resources:
|
| Comment by Jawad Ahmed Khan [ 25/Jul/16 ] |
|
Hi Craig, Thank you, Jawad Ahmed Khan |
| Comment by Jawad Ahmed Khan [ 21/Jul/16 ] |
|
H Criag, db.CallLog.aggregate([ , , , } ], { allowDiskUse: true }) Ulimit Stettings: [mongo@rtplnspvwcl02 mongodb]$ ulimit -a [mongo@rtplnspvwcl03 mongodb]$ ulimit -a [mongo@rtplnspvwcl02 mongodb]$ ps -ef | grep mongod [mongo@rtplnspvwcl03 mongodb]$ ps -ef | grep mongod Thank you, |
| Comment by Craig Wilson [ 20/Jul/16 ] |
|
Sure, seems right. Keep in mind that in the shell, it's only going to pull back 20 rows at a time, so you'll need to call ToArray() or something like that to exhaust the documents. Try both with and without. |
| Comment by Jawad Ahmed Khan [ 20/Jul/16 ] |
|
Thank you Craig for the quick response. Let me get back to you on the performance of the query from shell. I will be using the following query as shell equivalent . Let me know if that is not correct db.CallLog.aggregate([ , , , } ], { allowDiskUse: true }) Thank you, |
| Comment by Craig Wilson [ 20/Jul/16 ] |
|
Hi Jawad, Does this go faster in the shell, or...? Have you run an explain on this to see if you are hitting indexes? It looks like you are manually constructing the pipeline, so it's not the driver that would be causing this to go slow except for deserializing the results into CallLog entities. Craig |