How to reduce memory consumption an AWS EC2 t1.micro instance (free tier) ubuntu server 14.04 LTS EBS

Posted by CMPSoares on Server Fault See other posts from Server Fault or by CMPSoares
Published on 2014-06-10T03:37:42Z Indexed on 2014/06/10 9:27 UTC
Read the original article Hit count: 128

Hi I'm working on my bachelor thesis and for that I need to host a node.js web application on AWS, in order to avoid costs I'm using a t1.micro instance with 30GB disk space (from what I know it's the maximum I get in the free tier) which is barely used. But instead I have problems with memory consumption, it's using all of it.

I tried the approach of creating a virtual swap area as mentioned at Why don't EC2 ubuntu images have swap? with these commands:

    sudo dd if=/dev/zero of=/var/swapfile bs=1M count=2048 &&
    sudo chmod 600 /var/swapfile &&
    sudo mkswap /var/swapfile &&
    echo /var/swapfile none swap defaults 0 0 | sudo tee -a /etc/fstab &&
    sudo swapon -a

But this swap area isn't used somehow. Is something missing in this approach or is there another process of reducing the memory consumption in these type of AWS instances?

Bottom-line: This originates server freezes and crashes and that's what I want to stop either by using the swap, reducing memory usage or both.

© Server Fault or respective owner

Related posts about amazon-ec2

Related posts about amazon-web-services