Upgrading a Lightsail instance is an incredibly easy procedure. If you have been thinking about it and don’t mind the expect expense associated with a more powerful virtual server, than I’d recommend making the plunge. A little extra CPU power, possibly an extra core, and more memory can really brute force some slowness.
This whole job should take about 10 minutes of active time (that’s not including the time to create snapshots and fire up the new instance, neither of which tend to take very long).
Lightsail virtual private servers have an instance size, which basically dictates their specifications, or what allocation of the larger server they have allocated to them. Unlike a shared server this is a reservation on those resources and you have them whether you use them or not. The downside is that if you need more the server doesn’t auto-expand so add instances on its own to meet the increased demand. This is why you want some overhead built into your instance.
So you have your instance running and it seems like it’s lagging. Or you ran
top and things looks a bit hairy. Don’t worry.
The first thing you are going to want to do is to create a backup of your instance. This will be done using a snapshot. You can do this automatically or you can automate Lightsail snapshots on your own using Lambda jobs. You can make a manual snapshot by going into your instance and then to the Snapshot tab and clicking “Create Snapshot.”
Keep in mind that this is a snapshot or your whole server — all its settings, customizations, etc. This isn’t just an export of your chosen function for the Lightsail instance (WordPress, Node.js, Drupal, LAMP stack, etc.).
Now that the backup is done, simply go to the snapshot and click on the three dots on the right (it’s an ellipsis, but vertically oriented). You’ll get a menu with options to Create a New Instance, Copy to Another Region, Export to EC2, or Delete. You want to create a new instance using this snapshot.
After choosing “create” you will get some handy options. Now is the time you can:
So now’s the time to choose a new, more powerful instance. I recently moved a database-driven project from 1 vCPU/512MB memory/20GB SSD to 1 vCPU/2GB memory/60GB SSD and the difference was staggering. It’s great to optimize projects, but it’s even better when $5 a month fixes the problem for you.
Now the new instance is created and you can test it out. Using the SSH and the included IP, you can get into the command line to test or you can visit the live site. If everything looks good, it’s time to move to production.
Now all you need to do is detach your static IP from the production site and move it over to your new instance. This will tell Amazon to sent traffic to the new box, not the old one. Pretty simple! This will be more complex if you load balancers, etc. but it should be a simple operation since if you created the original instance you’ve done this once already.
Lastly, you’ll want to stop your old instance from running. You don’t need to delete it, but there probably isn’t a need to keep it active. Keep in mind that you DO get charged for have a stopped instance so if there isn’t a need for that instance any more, you should consider deleting it, or at least downgrading to save some money.
Sal Cangeloso November 22nd, 2019
Posted In: AWS