0

We are using .NET 6 web api inside docker container on linux. Our issue is that sometimes randomly mongodb driver Find() function hangs for 16 minutes. The function call does not fail. We are using mongodb atlas and mongodb driver v 2.15.1 from nuget.

I have tried debugging mongo with shell but there is not any ongoing queries when the find function is hanging.

Our request flow Frontend => NginX => reverseproxy to web api that is in docker container.

The fun part is that when you use and navigate the web page continuously that calls the web api none of the request left pending/hanging but if you idle on the page for few minutes and again stat to use page and navigate one request goes to pending and hangs for 16 minutes.

10
  • check what happens in server logs
    – dododo
    Commented Jun 6, 2022 at 19:35
  • Try specifying ReadTimeout like with 1 min. Will it help?
    – dododo
    Commented Jun 6, 2022 at 22:25
  • Cant get logs because of the free tier of mongodb atlas tier. We got the same pending issue from other web api which is requesting the atlas database on c# .NET 6 and the hanging time was exactly same. 16 mins and +-10 secs. This webapi does not even has Nginx or dockercontainer which could make some twists to network traffic.
    – jooseba
    Commented Jun 7, 2022 at 7:14
  • Try setting ReadTimeout first
    – dododo
    Commented Jun 7, 2022 at 8:37
  • We have having the same issue but ours is only a 13 minute delay. We are on AWS with VPC peering setup and running on Fargate in case that makes a difference. Did you end up finding a fix or get a response from Mongo on this problem or just gave up?
    – Seer
    Commented Oct 26, 2022 at 3:20

1 Answer 1

0

We decided to get rid of MongoDB Atlas and instead run mongodb locally on a virtual machine. All the pending and hanging errors are gone now.

1
  • it's not equivalent replacement, but obviously it's up to you
    – dododo
    Commented Jun 7, 2022 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.