0

I am working on a project with large amount of live data by asp.net core 2.0, C# and MongoDB. I have thousands of sensors which send live data to the server. I have a problem with network issues. This is possible that my web-server for a few minutes can not communicate with database Server. I've tried to test it locally, if it is about 20 or 30 seconds, web-server will resume, but if it goes to more than a minute, web-server will lost the connection and after that I need to restart the application. I tried to use connectionTimeOutMS and socketTimeOutMS but those couldn't help me.
How can I prevent that and handle this problem? Is there any solution or backup plan to handle this?

Mhmd
  • 15
  • 6
  • 1
    Lot's of good info here that might help: https://stackoverflow.com/questions/13980236/does-mongodb-have-reconnect-issues-or-am-i-doing-it-wrong – JohnnyHK Jun 08 '18 at 14:41

1 Answers1

0

Thanks to @JohnnyHK for great help. I could solve the problem by adding serverSelectionTimeoutMS to the connection string.

Mhmd
  • 15
  • 6