A meteor falls on the smallest DigitalOcean Droplet (from memory: Kill process ...)

I am launching a Meteor application on a base (512 GB) drop of DigitalOcean. From time to time, Meteor simply crashes with this error message:

enter image description here

Out of memory: Kill process 9682 (node) ... ... => Exited from signal: SIGKILL FATAL ERROR: JS Allocation failed - process out of memory 

What's wrong? This is a really simple application and it cannot spend all the memory.

+5
source share
6 answers

You can keep the smallest drop if you want. I had the same problem on my DigitalOcean digital okuner worth $ 5, 512 MB RAM and 20 GB SSD. I did not update, but instead implemented the exchange as follows:

Create and enable the swap file using the dd command:

 sudo dd if=/dev/zero of=/swapfile bs=1024 count=256k 

"of = / swapfile" denotes the file name. In this case, this is the page file.

Then prepare the swap file by creating the linux swap area:

 sudo mkswap /swapfile 

Results show:

 Setting up swapspace version 1, size = 262140 KiB no label, UUID=103c4545-5fc5-47f3-a8b3-dfbdb64fd7eb 

Exit by activating the page file:

 sudo swapon /swapfile 

After viewing the swap, you can see the new swap file.

 swapon -s Filename Type Size Used Priority /swapfile file 262140 0 -1 

This file will last on the virtual private server until the computer restarts. You can guarantee that the exchange will be permanent by adding it to the fstab file.

Open the file:

 sudo nano /etc/fstab 

Paste in the following line:

  /swapfile none swap sw 0 0 

Happiness in the file should be set to 10. Skipping this step can lead to poor performance, while setting it to 10 will cause swap to act as an emergency buffer, preventing out-of-memory crashes.

You can do this with the following commands:

 echo 10 | sudo tee /proc/sys/vm/swappiness echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf To prevent the file from being world-readable, you should set up the correct permissions on the swap file: sudo chown root:root /swapfile sudo chmod 0600 /swapfile 
+15
source

I was able to fix this problem using more swap space than originally indicated (over 256 MB) up to 1 GB.

To resize swap space on Ubuntu to 1 GB:

 sudo swapoff -a sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 sudo mkswap /swapfile sudo swapon /swapfile 
+2
source

I found a problem.

https://github.com/joyent/node/wiki/FAQ#what-is-the-memory-limit-on-a-node-process

I used only 512 MB of RAM for a 64-bit system. But this is not recommended for the node process.

+1
source

You can try setting the swap file to a drop of DigitalOcean.

DO did an excellent guide on how to do this. You can find it here:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

+1
source

I believe this may be due to a problem that a meteor may have. Check out the comment showing CPU usage in this github issue. https://github.com/meteor/meteor/issues/2536#issuecomment-55295490

0
source

Responding to Marek’s answer,

I run the Meanjs app on Digital Ocean, and although everything worked fine locally, and when I tested my app live, as soon as the second user logged in, it would run out of memory and crash.

Instead of trying the whole swap thing, I just upgraded it from $ 5 / month for 512 MB of RAM to $ 10 / month with 1G, and so far I have received up to 6 machines with multiple Chrome and Firefox browsers. while accessing it well.

0
source

Source: https://habr.com/ru/post/1202451/


All Articles