So my meteor instance behaves very weird and slow after some big database operations.
While running my (local) meteor instance, I do a mongorestore --dump
operation on two of my most important (and largest) collections.
After the restore, meteor peaks at 100% cpu for like one minute before it responds again.
After that, when I try to do something within the collection I just restored, the whole process hangs up and is stuck indefinitely. Also any code changes take FOREVER until the meteor server successfully restart. After restarting my whole meteor app (Ctrl+C, npm run dev
), it works again!
Problem is: If this does only occurs locally I would be totally fine with that. But I am running into similar problems on my production server, where a function, which does big operations on the mongo DB data, sometimes completely f*cks up my meteor process and is stuck forever until a restart (no need for any mongorestore stuff before that). It just kinda stops in the middle of some DB operations and peaks at 100% CPU. No CPU, RAM or HDD issues there, more than enough space! This is a huge problem for me!
Can anyone help?
EDIT:
So this is now very weird! After restarting my docker container on my production server after it got stuck in this “big DB operations function” like 15mins ago, it was very quick now!
I made NO CHANGES to the code base or anything, I just ran the same code again and now it was very quick.
I just don’t understand this … is there any weird caching happening in meteor in the background or whatever? I just don’t understand how a simple restart can make a function suddenly be like 30 times quicker with no code changes, no RAM or HD limitations, …