Mongodb database freezing

We have a Primary server with Secondary ones.

Sometimes it freezes without any error messages, and it crashes and doesnt take any connection nor respond to commands.

If i do the shutdown command, it logs: got request after shutdown()

I tried to track all the syslogs and mongo logs, I couldn’t find anything, just the connection takes too much time to close.

Did anyone ever experience this error? and what was the solution for it?

Hi @Rhea_Moubarak welcome to the community!

Typically if a server freezes, it’s being overwhelmed. The usual culprits are: the hardware is not powerful enough to serve the regular workload, or some clients are flooding the server with a spike of a lot of work and the server is working very hard to serve everything. Some starting points is to see if there’s any pattern in the freezes. Does it happen at certain time, or all the time? Is the server dedicated to MongoDB, or are there any other applications running there? Are you running more than one mongod processes inside one server?

You might want to check out the output of mongostat during this period, and also the output of iostat (in a Linux server) and check if the hardware is being pushed to the max.

Best regards
Kevin

2 Likes