A Mongo database is queried by a c# client which is not on the same lan. As far as I know they are 30 km far, but an icmp ping shows a latency <1ms.

I noticed some exceptions generated by the client in the Mongo driver, so to test the stability of the network I check the connection to the server every second in the following manner:

var client = new MongoClient(settings);
var database = client.GetDatabase("portineria");

The command fails with exception or returning false more than 20 times for hour. Instead a simple icmp ping fails few times (< 5) per day.

Is the test I'm doing a valid one to determine the quality of the network or it can be biased by other factors ? I don't have a test environment where I can put both client and server on the same lan to check the stability of the connection and verify the above command never fails. Is there something else I can try to increase the reliability with some configuration parameters ? How can I investigate better the real causes ?

  • Mongodb was completely innocent. It turned out that the client and mongodb were instead in the same site and it explains the low latency. The network problems were caused by an entry level access point used to connect a wi-fi printer. It is weird no other application in the lan was affected by these momentary network interruptions. – Filippo Oct 8 '20 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.