From ad7a7a6161e4640b9e21bf327242e097b995efeb Mon Sep 17 00:00:00 2001 From: LimHyunwoo <81962309+imenuuu@users.noreply.github.com> Date: Sun, 3 Dec 2023 15:38:58 +0900 Subject: [PATCH] =?UTF-8?q?CI=20:=20swap=20memory=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ebextensions-dev/01_set_up_swap.config | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .ebextensions-dev/01_set_up_swap.config diff --git a/.ebextensions-dev/01_set_up_swap.config b/.ebextensions-dev/01_set_up_swap.config new file mode 100644 index 0000000..6b82f6f --- /dev/null +++ b/.ebextensions-dev/01_set_up_swap.config @@ -0,0 +1,26 @@ +files: + "/home/ec2-user/setup_swap.sh": + mode: "000755" + owner: root + group: root + content: | + #!/bin/bash + # based on http://steinn.org/post/elasticbeanstalk-swap/ + + SWAPFILE=/var/swapfile + SWAP_MEGABYTES=2048 + + if [ -f $SWAPFILE ]; then + echo "Swapfile $SWAPFILE found, assuming already setup" + exit; + fi + + /bin/dd if=/dev/zero of=$SWAPFILE bs=1M count=$SWAP_MEGABYTES + /bin/chmod 600 $SWAPFILE + /sbin/mkswap $SWAPFILE + /sbin/swapon $SWAPFILE + +commands: + 01setup_swap: + command: "bash setup_swap.sh" + cwd: "/home/ec2-user/"