Sunday, July 23, 2017

Amazon Lightsail doesn't have virtual memory

My cloud hosting needs are modest. A couple of Wordpress blogs, an OpenVPN server, and a Tiny tiny RSS server. I use Amazon’s AWS services for S3 storage for miscellaneous files and backups using ARQ. When Amazon launched Lightsail with a VPS starting at just $5 a month (for 512MB RAM and 20GB SSD), I moved over from Linode where I was paying double that.

All seemed good at first, Amazon’s infrastructure gave me better ping times than others, but I noticed that mysql was going away from time to time. Tailing the system log I could see kernel out of memory messages and that it was killing mysqld. You see entries saying "OOM". The kernel kills the process that's using the most memory which tends to be mysqld.

My first thought was to increase the RAM but there’s no simple way to do this on Lightsail, you must take a snapshot (backup), make a new instance with the new memory and build it from the snapshot. When all is up the external static address is simply re-pointed to the new instance and the old instance can be stopped. This isn’t at all difficult but it seems like something computer software should do.

After upgrading the RAM it dawned on me why Linux was running out of RAM - Lightsail instances have no virtual memory! It turns out there’s no easy way to add a swap partition and they actually warn that if you did it would be too slow.

Paying $10 a month for a Lightsail instance with zero virtual memory becomes uncompetitive with my old favourite Linode who offer 1GB RAM and 30GB SSD including VM for the same price.

So, I’m back on Linode and frankly happy to be there. Amazon is a gorilla in the hosting game but their offering is incredibly complex and, it turns out, has some little gaps.

I realise my home use is at the very low end but, as the song says, “from little things, big things grow”.

Not having any virtual memory is a major problem for any real server.

Update: another low cost VPS provider: Vultr

Vultr is a new provider of virtual machines that starts (at the time of writing) at US$2.50 per month for 1CPU, 512MB memory, 20GB SSD and 500GB of bandwidth.
A suggestion from John.

Bandwidth is charged at the maximum of incoming and outgoing. Excess bandwidth is charged at 1 to 5 cents per GB (depending on where). You continue to be charged for a stopped instance - you must "destroy" it to stop being billed.

OS options are CentOS, CoreOS, Debian, Fedora, FreeBSD, OpenBSD, Ubuntu, Windows or upload your own.

They claim to be faster than competition from AWS and Rackspace and given that I'm in Sydney and they have a location here, I'm going to give them a shot.

Accounts must be topped up before use, so I guess this is pre-pay, but once a first payment has been made they take Bitcoin which is handy.

Hmm, bait and switch eh? It turns out that once you pay them some money, the US$2.50 server size is "sold out" in Sydney... not impressed. By default the Ubuntu image has no swap, like Lightsail, but they have a guide to manually adding a swap file.

1 comment:

BakaOppai said...

Its actually really easy to add swap file to lightsail instance if you know anything about running a linux server. Even if you don't.. Just go look up a tutorial for the OS your chose.