ADDING SWAP TO AWS EC2 INSTANCE + MEMORY ALLOCATION PROBLEM

Adding Swap to Aws EC2 instance:-

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

If you need more than 1024 then change that to something higher.

To enable it by default after reboot, add this line to /etc/fstab:

swap        /var/swap.1 swap    defaults        0   0

To turn ON the swap do the following:

swapon -a

To turn off the swap do the following:

swapon -a

To turn off the swap do the following:

sudo /sbin/swapoff /var/swap.1

Comments

Popular posts from this blog

psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

CARRIERWAVE - UPLOAD ANY MEDIA (AUDIO , VIDEO AND IMAGE ) FILE IN RAILS

E: Package 'aptitude' has no installation candidate

SEARCHING USING AJAX IN RAILS

SELECT COUNTRY WITH STATE AND IT'S CITIES RAILS

RAILS: UPLOADING PHOTOS VIA AMAZON S3 AND PAPERCLIP (UPLOADING FILES TO S3 IN RUBY WITH PAPERCLIP)

CURL COMMAND ON RUBY ON RAILS

CHECK PASSENGER RUBY PATH

SHOW LINE NUMBER OF TEXT AREA