Mannu
Mannu

Reputation: 75

Node.js process getting killed on aws instances

We are trying to deploy one of our node js applications(AngularJS/NodeJS tech stack) to Production environment. Randomly, some of the ec2 instances just goes down as node process is getting killed. But no application/system level error messages are getting logged. We are unable to replicate this issue in local/dev/it environments. Has anyone faced something similar? Any help is much appreciated. Thanks!

Upvotes: 4

Views: 2392

Answers (2)

Hosar
Hosar

Reputation: 5292

I know this is an old question, just in case someone else run into the same problem.
Most probably is that your a running out of memory, as explained here. You can verify with dmesg command (linux). To fix it you can add more memory or add a swap volume.
One way is following this answer:

sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1
// enable after reboot
/var/swap.1 swap swap defaults 0 0

Upvotes: 6

MarkoCen
MarkoCen

Reputation: 2324

By default, nodejs application would be stopped when no client connect to it, you could use some tools like forever to keep your nodejs app running

Upvotes: -2

Related Questions