freezingsaddles / freezing-compose

The Docker Compose structure for running the application suite.
Apache License 2.0
5 stars 2 forks source link

Freezing Saddles instance is experiencing low memory alerts #20

Closed obscurerichard closed 2 years ago

obscurerichard commented 2 years ago

I've been getting Icinga alerts for the Freezing Saddles server that it is running low on swap space for a while.

This is running on Amazon Lightsail now, and to switch to a larger instance size we have to snapshot the server and start a new instance with a larger instance size. That will involve 5-15 minutes of downtime.

Another option is to convert this to EC2, and use a larger instance size, such as t3.medium, but that may require also switching from Lightsail PostgreSQL to RDS. That would give us more flexibility but also introduce more complexity into the administration of the system.

obscurerichard commented 2 years ago

As a temporary measure, I have added another 2 GB of swap space on /swap2

sudo dd if=/dev/zero of=/swap2 bs=1M count=2048
sudo mkswap  /swap2
sudo chmod 0600 /swap2
sudo swapon /swap2
vi /etc/fstab #add swap2

We are OK on disk space and memory now:

[centos@freezingsaddles ~]$ free -h ; df -h
              total        used        free      shared  buff/cache   available
Mem:           989M        404M        160M         25M        424M        403M
Swap:          3.0G        719M        2.3G
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        470M     0  470M   0% /dev
tmpfs           495M     0  495M   0% /dev/shm
tmpfs           495M   57M  438M  12% /run
tmpfs           495M     0  495M   0% /sys/fs/cgroup
/dev/xvda1       40G   20G   21G  50% /
tmpfs            99M     0   99M   0% /run/user/1000
obscurerichard commented 2 years ago

As part of https://github.com/freezingsaddles/freezing-compose/issues/18 I moved this from Lightsail to EC2 and now it is running on a t3.small instance with 2GB of RAM. Now it is only using 87M of swap and has a ton of free memory and disk space:

              total        used        free      shared  buff/cache   available
Mem:           1.8G        884M        113M        142M        801M        590M
Swap:          3.0G         87M        2.9G
[centos@ip-172-31-86-46 compose]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        875M     0  875M   0% /dev
tmpfs           900M     0  900M   0% /dev/shm
tmpfs           900M  108M  793M  12% /run
tmpfs           900M     0  900M   0% /sys/fs/cgroup
/dev/nvme0n1p1   40G   22G   19G  54% /
tmpfs           180M     0  180M   0% /run/user/1000
tmpfs           180M     0  180M   0% /run/user/0