I have a node.js application on my EC2 instance. I am using pm2 to run the process. Everything here goes well but sometimes what happens is that the memory on the server gets exhausted.When this happens the mongodb connection closes and there remains no space to even save logs I guess.
Whenever this happens I have to ssh to server and clear the logs and then restart the mongodb service and then reload all pm2 processes. There is no option to increase the storage space on EC2.
I am currently running my production app on t2 large instance but still it goes out of memory.