Request timeout in MongoDb

Does anyone know how to add a timeout for requests on the server side of MongoDb? No client-side wait time (I am using the C # driver). I have a problem with the client crashing and the connection to Mongo is dying, but the server continues to execute requests. This leads to a huge increase in unnecessary / outdated requests in the server queue.

+4
source share
1 answer

If you have these long requests from a previous client connection that you want to stop / kill, you will either have to manually kill them in:

http://www.mongodb.org/display/DOCS/Viewing+and+Terminating+Current+Operation

Or, when you launch your new client, you can do something more programmatic (get the latest requests from the log, kill them because they are from the previous client). Regardless of whether you can programmatically identify the operations you want to kill and avoid killing others - this is the key here - you may need to add some entries in your application to track your flight.

+1
source

Source: https://habr.com/ru/post/1396693/


All Articles