Skip to content

Commit b76fcf5

Browse files
committed
feat docs: add troubleshouting for Mongo Congestion Control
Tests: на прод не влияет commit_hash:4af1e33d06006d3449a3cfaeefd0ccbdf7017f70
1 parent d3fa66c commit b76fcf5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

scripts/docs/en/userver/mongodb.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,31 @@ eliminates the extra load. On the one hand, it leads to extra error responses, b
9999
on the other hand, it greatly lowers the timings of the rest of the database
100100
requests and helps Mongo to return to the normal state with lower response timings.
101101

102+
103+
#### Mongo Congestion Control Activation Troubleshooting
104+
105+
If the Mongo CC for service is active (the service logs contain "Congestion Control DATABASE_NAME is active" and/or the
106+
metrics have `mongo.congestion-control.is-enabled` set) and the workload is usual for
107+
the service, then something is wrong with the database. Service or database maintainers should resolve the issue.
108+
109+
**Steps to troubleshoot:**
110+
111+
1. Start by locating the requests that execute for a long time. Take a look at the
112+
`mongo.by-[database|collection|operation].timings*` metrics to locate the database, collection and operation that
113+
cause the most of the database load. Also take a look at the metrics that are reported by the Mongo database
114+
directly (not by the userver based service).
115+
116+
2. Ask your favorite WEB search engine or AI for an information on how to optimize the slow queries in MongoDB. Usually
117+
adding indexes or sharding the database does the job.
118+
119+
3. The slowdown could be caused by MongoDB sending megabytes of responses to your service on a slow connection:
120+
* Verify that the application logic is optimal, no unnecessary data is retrieved
121+
* Minimize network interactions with @ref components::MongoCache.
122+
123+
4. If most of the queries run slowly or all of the queries take similar time, then the bottleneck could be in the
124+
database resources. Make sure that the database has enough CPU, RAM and Network Throughput resources.
125+
126+
102127
----------
103128

104129
@htmlonly <div class="bottom-nav"> @endhtmlonly

0 commit comments

Comments
 (0)