Hello everyone, I am turning to you as I am really getting not only confused but out of my mind.
I have a managed MongoDB 6 database instance on DigitalOcean. The instance has: 1 GB RAM / 1vCPU / 15 GB Disk - yes I know it is not a big one.
Most of the time the instance is running at 10-15% CPU and 85% of RAM used.
The DB has quite a few TimeSeries collections. I have been playing with indexes to get the performance better but without any real success. But that is another thing.
Now I wonder about one thing. When I run some query, that gets about 5K of records from a server. The query resolution takes about 3-5 seconds (yes, slow but again, that is another case).
What is a lot more scary and really blows my mind is that after some time (from the DO monitoring it looks like a minute or two later) the server starts experiencing a complete exhaustion! The CPU utilization jumps to 75-100% and stays there for about 30minutes!!! Then it briefly drops and after a few minutes raises back to 75-100% again for another 15 minutes!!!
Sometimes this cycle repeats 2-3 times and then eventually the server resumes normal operation.
I just do not understand what is happenning there. Why the server gets so blocked and stops responding even after the query already long time completed?
Any explanation and IDEA how to resolve / prevent this?
Thank you very much in advance!