I have a function in my node.js server which runs docker containers, listens to stream and is CPU heavy, as I can see when running it in a docker container. After it is done, the server becomes very slow, mostly queries to it's MongoDB database using Mongoose. I tried building the server using production flag but it does not help. Only restarting the service itself makes it fast as it was when it started. I don't understand enough to know what to monitor regarding usage of node.js. How can I find the root cause/make sure node.js cleans up resources after finishing this function?