[GODRIVER-2774] mongo-driver v1.9.1 Cursor.All cpu is very high Created: 15/Mar/23 Updated: 27/Oct/23 Resolved: 02/May/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | z hh | Assignee: | Qingyang Hu |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
Please help me see how to solve it |
| Comments |
| Comment by PM Bot [ 02/May/23 ] |
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. |
| Comment by Qingyang Hu [ 24/Apr/23 ] |
|
Hi 826081159@qq.com, we were trying to reproduce the issue here. Currently, we believe most of the CPU time is spent on runtime.mallocgc when cursor.All() is called for large documents. Meanwhile, we'd appreciate it if you could profile your program and share the results here. The profiling diagram may accelerate the investigation by locating the hotspots in your scenario. More information about profiling can be found here and here. |
| Comment by z hh [ 03/Apr/23 ] |
|
Hello, qingyang.hu@mongodb.com,as follows, 1. cur, err = collection.Find(context.Background(), filter) 2. var res interface{} cur.All(context.Background(), res);I found that the CPU utilization in the second step is very high when the request data is relatively large and the qps is around 30 |
| Comment by PM Bot [ 30/Mar/23 ] |
|
Hey 826081159@qq.com, We need additional details to investigate the problem. If this is still an issue for you, please provide the requested information. |
| Comment by Qingyang Hu [ 22/Mar/23 ] |
|
Hello 826081159@qq.com, can you please let us know the type of "res" in your code? And it will help investigation if you can provide CPU profiling. |
| Comment by z hh [ 22/Mar/23 ] |
|
I tried it. If the number of requested data items is large (1000), the CPU will increase if the concurrency is large during result parsing; Maybe it's a problem with bson decoding |
| Comment by Esha Bhargava [ 20/Mar/23 ] |
|
826081159@qq.com Can you please include more information about what query you are running and the examples of documents that are being returned? Can you also provide a reproducible example and try the latest version of the driver? |