Amazon Lightsail vs EC2 Ultimate Guide

Trying to understand the difference between Amazon Lightsail and EC2? Learn about both including their pros and cons in this article.

Amazon Lightsail and EC2 are two very different compute options offered through AWS. Both offer the ability to host applications including things like websites, web apps, or WordPress blogs. However, Lightsail and EC2 are aimed at two very different audiences.

Overview

In this article, we’re going to be exploring the difference between Amazon Lightsail and EC2. We’ll start by reviewing what Amazon EC2 is and some of the challenges with using it to host Virtual Private Servers.

From there, we’ll explore the emergence of Amazon Lightsail and understand the role it plays in the AWS ecosystem.

We’ll close things out in a final summary section discussing the pros and cons of using Lightsail or EC2.

By the end of this article, you’ll have a good understanding of both Lightsail and EC2 and be able to pick the best option for your next project.

So let’s start by exploring Amazon EC2.

What is Amazon EC2?

EC2 stands for Elastic Compute Cloud. It is one of the first services launched on AWS in 2006. EC2 is a service offered by AWS that allows you to rent virtual servers to use for compute workloads.

AWS users can rent a variety of different machine types. This ranges from tiny micro-sized instances with 512MB of memory and 1 vCPU to giant ones with 384GB of memory and 96 vCPUs. Pricing varies depending on the instance. You can learn more about EC2 instance types in the AWS documentation.

The different classes of EC2 instances you have available to choose from. Within each class, you can select the tier of instance. Small tiers (micro) are less powerful and Large Tiers (8xl) are more powerful and more expensive.

To add to the convenience, users of EC2 do not need to have long-term commitments to the hardware they rent. Users can simply spin up an instance, perform the workload, and spin it down when they’re done. To achieve a more attractive price point, however, you do have the option of purchasing commitments for longer terms at a discounted rate.

If you wanted to run a long-running workload like hosting a website or a WordPress blog, that’s possible too with EC2. Since AWS charges on a pay-per-use model (hourly in the case of EC2s and dependent on instance type), you can certainly use EC2 to run long-running or steady state jobs.

With EC2, users no longer needed to buy expensive physical hardware, worry about installing it, and then of course maintain it over time. Instead, users could now rent machines for as long or as short as they need, and spin them down when they’re done. Pretty remarkable stuff.

The Problem with EC2

Fundamentally, the problem with EC2 is that it’s complicated and somewhat cumbersome to manage. It assumes the person using the service is technical and knows how to configure, launch, deploy, and maintain their software applications.

Further, if you’re a person just getting started with AWS trying to set up a basic website or blog, for instance, you may get overwhelmed with the number of concepts you need to learn and set up to perform.

As you can see in the image below, there are several steps to walk through when creating your EC2 instance. You need to specify the Amazon Machine Images (AMI) to use which is effectively the launch configuration, instance type, security configuration, and many more options. And this is the Quick Start version of the console!

In the console, there are many steps to walk through and many concepts to be aware of. Here we are selecting the AMI or Amazon Machine Image to base our instance on. The red arrow indicates the number of steps we need to walk through to launch our instance.

Users of EC2 also need to worry about things like security patching and upgrades. If you’re using a software application that has a dependency on a newly discovered vulnerability, that’s up to you to patch it.

Further, EC2 users need to worry about network security as well. Launching an instance and accidentally making it available to the public internet without proper safeguards is an all too common occurrence. You kind of need to know what you’re doing to not land yourself in hot (and potentially expensive!) water.

To put it briefly, using EC2 is akin to renting a bare-bones server and using it as you please.

But sometimes we don’t want to worry about the details of managing a server. Sometimes we want servers to come a bit more pre-packaged and offer out-of-the-box functionality. For example, hosting a LAMP stack or a WordPress blog.

Sometimes we want things to be a little bit more…. simple.

This is where Amazon Lightsail fits in.

What is Amazon Lightsail?

Amazon Lightsail is a service that offers pre-packaged variations of common software configurations. Software configurations come in a variety of different well-known configurations such as NodeJS, MEAN, LAMP, WordPress, Django, and many more.

The core advantage of using something like Lightsail is simplicity. The services handle much of the heavy lifting for you and allow you to focus on developing your application. It’s a lightweight offering that is meant to get you off the ground quickly.

The creation experience of provisioning a Lightsail instance is another attractive factor. Since AWS is targetting a segment of the population that wants to simplify setup, it makes for a much cleaner UI experience. It’s much akin to what you would see on competitor products like Digital Ocean or even GoDaddy.

You may enjoy this article on Website Hosting Options on AWS – Picking the Right Option for You

Similar to EC2, users first select the region and availability zone the instance will be present in. Typically users select the region that is closest to where their customer traffic is going to be originating from.

In addition, folks need to Select a platform by selecting either Linux/Unix or Windows. Do note that if you opt to go with a Windows instance, the prices are much more expensive (almost 3 times as much) compared to a Linux/Unix machine at similar specs. I expect this is to do with the additional licensing around using Windows products but this is just speculation.

The Lightsail wizard requires us to select our region/availability zone, platform, and blueprint. Many launch blueprints are available for the most common configurations.

Next, users need to select whether they would their instance with any Apps, or just want the Operating System (OS) installed.

Both may be suitable depending on your use case. However, I like to think most folks use Lightsail because they want to simplify things and would opt to go with a preinstalled App.

Lightsail Pricing Model

Lightsail offers a more simplified pricing model. Instead of having to decide on the instance type and series, Lightsail makes your life easier and offers 7 plans ranging from as low as $3.50 per month up to $160 a month. Of course, the more expensive machines are much more powerful. See this link from Lightsail’s documentation for more info on pricing.

As you slide up the scale in the pricing model, you’ll have access to a machine with more memory, more CPU, more storage space, and more transfer bandwidth.

To be honest, I suggest most users start with the lowest $3.50 a month plan. These powerful little boxes are quite powerful and were capable of handing ~400 daily users on my Lightsail based WordPress blog. It’s also very easy to upgrade your instance later if you find that the instance you selected isn’t cutting it in terms of performance.

Lightsail offers a simplified pricing model when compared to EC2. Users select a tier that has increased performance characteristics. Also increasing in each tier (generally) is the sustainability zone which we’ll learn more about below.

It’s also worth noting that AWS offers the first 3 months free for the first 3 plans – so that’s the $3.50, $5.00, and $10.00 a month plans. This applies to all accounts so if you want to tinker around with Lightsail at no extra charge now is the time!

Behind the Scenes of Lightsail

Some folks may be interested in how AWS manages a service like Lightsail behind the scenes.

Although there is no official confirmation from AWS that I could find, there is speculation that Lightsail instances are in fact T2 classes of EC2 instances behind the scenes.

The T2 instances support a notion of “burstable” CPU power where an instance can increase CPU utilization beyond the usual threshold for a short period of time. This is a striking resemblance to the characteristics of Lightsail instances.

This makes sense of course for AWS to use their own EC2 service as the backbone of Lightsail.

Next, let’s explore a bit more about the performance characteristics of your Lightsail instance and how it compares with a traditional EC2 machine.

Lightsail Performance and Burstable Instances

An important consideration of using Lightsail is this notion of burstable performance with “sustain” periods and how it impacts the performance of your instance.

If you were to rent an EC2 instance from AWS, you have access to 100% of the CPU of that in that instance. That means you could run up a process indefinitely at 100% CPU utilization with no issue.

With Lightsail, the CPU utilization is metered. What this means is that instances cannot operate above the Sustainability Zone (green arrow in the image below) for a prolonged period of time. If instances do need to surpass this threshold, they can “burst” past it and utilize more CPU cycles. However, this can’t last forever.

The image below is from the AWS Lightsail documentation and should help you understand how the CPU Burst Capacity and Token bucket algorithm work. If you need additional detail, refer to the Lightsail documentation.

CPU burst capacity accrual and consumption
Token bucket algorithm used by Lightsail to allow the instance to burst past the sustainable zone for short periods. Over time, burst “credits” will regenerate, allowing your instance to burst again if necessary. Source.

Burst can only last for as long as you have burst CPU available. CPU Burst capacity becomes available over time, almost in a “regenerative” fashion (see the yellow arrow in the image below). Behind the scenes, this uses a token bucket algorithm that will max out at around 100% extra CPU burst capacity.

A graph from a Lightsail instance used to host this WordPress blog! Originally I started with the $3.50 plan, but after seeing these large CPU spikes and degraded performance on my web page, I decided to upgrade. In this image, the yellow arrow indicates Burst CPU regeneration, the red arrows indicate a period of heightened CPU utilization that consumed Burst credits and the green points to the sustainability zone.

This notion of burstable CPU capacity is quite handy in cases where you expect short bursts of usage. However, if you were to experience a prolonged burst and exhaust all of your credits, your CPU will only be able to operate at the maximum of the Sustainability Zone (see red arrows from the example above).

The Sustainability Zone baseline percentage varies depending on the Lightsail Price Plan (or instance type) you selected. The numbers for Linux instances are as follows:

  • $3.50 Month Plan – 5% CPU Baseline
  • $5.00 Month Plan – 10% CPU Baseline
  • $10.00 Month Plan – 20% CPU Baseline
  • $20.00 Month Plan – 20% CPU Baseline
  • $40.00 Month Plan – 30% CPU Baseline
  • $80.00 Month Plan – 22.5% CPU Baseline
  • $160.00 Month Plan – 17% CPU Baseline

Interesting the CPU baseline starts to lower as you get to the top end, likely due to the non-linear performance gains you get by adding more power.

Additional Lightsail Features

Despite being a solution intended for simple applications, Lightsail does have a couple more advanced features for users looking to scaleable host high availability and low latency applications.

Lightsail offers the ability to put a Load Balancer in front of one or more of your Lightsail instances hosting your application. Load Balancers are effectively traffic distributors – they distribute traffic to instances that the load balancer is fronting. This allows your application to handle more traffic concurrently and is known as horizontal scaling. Alternatively, you could always just increase the instance type, but this has its limits. Also note the latter example is a form of vertical scaling (in case you’re curious).

Additionally, Lightsail also allows you to add a CloudFront distribution in front of it. CloudFront is AWS’ CDN or Content Delivery Network service. The service optimizes performance for a geographically distributed user base by replicating server contents from the original region your application is hosted, to other servers all across the world.

Finally, Lightsail also offers you the ability to add additional storage volumes regardless of which instance type or price plan you selected.

Drawbacks of Lightsail

Lightsail is certainly a powerful compute option that simplifies much of the setup and management of your applications. However, it does come with a set of drawbacks.

Lightsail Drawback #1 – Customization and Flexibility

The fundamental drawback with using lightsail over something like EC2 is customization. With an EC2 instance, you’re able to use your machine as you wish. You’re able to swap in parts and form attachments to other AWS services.

This is useful from a flexibility perspective. It’s akin to deciding whether or not you want to build your own bicycle or buy a pre-made one from the shop. Sure you can build your own, but do you really want to spend the time learning about all the parts and how it fits together? For most probably not.

With Lightsail, your functionality is very limited. You won’t have access to more advanced features that users of an EC2 instance would have access to. For example, instance autoscaling is a feature offered by EC2 that allows your application to add more instances when your application is under heavy load, and remove them when the traffic subsides.

Lightsail Drawback #2 – Integration with Other AWS Services

Lightsail advertises the ability to integrate with other popular AWS services such as Amazon DynamoDB (NoSQL Database) or API Gateway to host REST/Websocket APIs.

Interesting to note though is that you can’t integrate with these services out of the box after setting up your Lightsail instance. You need to set up something called VPC Peering in order to allow network connectivity between your Lightsail instance and the desired AWS Service.

If you’re not already familiar a VPC stands for Virtual Private Cloud and it is a concept in AWS that allows all of your infrastructure to be self-contained to an isolated section of the network. In a VPC, the administrator needs to apply network configuration to allow infrastructure to communicate. VPCs are a safety net that allows users to shield their infrastructure from bad actors.

Since your Lightsail infrastructure operates in a Lightsail Managed VPC, you need to perform extra steps to let it talk to other AWS services.

This isn’t a huge deal and it’s pretty straightforward to set up as per the documentation. However, in my opinion, Lightsail is targeted at users looking to avoid complex configuration and having to understand other AWS concepts. So it’s a bit unfortunate that in order to enable cross-service support, you need to dive into the weeds of network setup.

Lightsail Drawback #2 – Monitoring and Observability

Another big drawback of Lightsail is in terms of Monitoring and observability. Since you’re not directly managing the EC2 machine that is hosting your instance, you don’t have access to all the usual logs and metrics you would normally have through Cloudwatch for an EC2 machine. This means you’re limited to the coarse-grained and limited metrics sets that Lightsail provides. This is particularly painful when trying to debug an issue.

If you’re a user that doesn’t care too much about the nitty-gritty details of your instance, then that’s fine. However, there have been a couple of times where I’ve tried to debug a high CPU utilization issue but got stymied by the poor resolution of metrics provided by Lightsail.

More specifically, Lightsail only offers metrics at 5 minutes granularity. Typically in other AWS services you have access to metrics at 1-minute granularity and even lower in some cases. This can make it frustrating when trying to assess the current state of your instance(s).

Lightsail Drawback #3 – Contained Console Experience

One of the quirks about using Lightsail in the console is that it is contained within a completely isolated part of AWS. Typically, users access and manage their service usage through the console home page. However, when using Lightsail, your brought to a much more simplified version of the AWS console as seen below.

New – Managed Databases for Amazon Lightsail | AWS News Blog
The Amazon Lightsail console experience is an isolated environment from your usual AWS console. You can always get back to your normal AWS account by clicking on the AWS logo at the top right of your screen.

The Lightsail console is a simplified version of the AWS console showing you just what you need to know about creating/managing your instance. This isn’t a huge concern but just an odd quirk about using Lightsail that some may want to be aware of.

Amazon EC2 or Lightsail? Which Should You Choose?

Ultimately, you need to decide between using EC2 or Lightsail for your project. Your reasoning can vary depending on the application and workload you’re trying to run. However, I think there are some general rules that you can apply to make this decision easier.

Use Lightsail If…

  • You want hands-off setup, configuration, and management of your instances at the expense of control and flexibility.
  • You want to host a simple wordpress blog, web app, or e-commerce application.
  • You don’t need auto scaling, granular metrics, or EFS.

Use EC2 If…

  • You want complete control over your instance including setup, configuration, and deployments.
  • You like to tinker with the underlying components and add/remove/swap pieces as you see fit.
  • You want to host webapps, backend services, databases, or anything else that has the ability to scale to hundreds of thousands if not millions of users.
  • You are planning on building enterprise grade applications.
  • You’re trying to run a custom piece of software such as a Spark cluster or Elasticsearch Database.

One thing to note is that you can always try out Lightsail or EC2 for free to see which one you like. Lightsail offers 3 months or so free for their bottom tier plans. Similarly, EC2 offers a free tier micro instance that you can use for a whole year.

Closing Thoughts

Lightsail and EC2 are two similar products but are aimed at two completely different target audiences. Lightsail prioritizes simplicity, ease of use, and hands-off management while EC2 prioritizes customization and scalability.

The decision to select one over the other should be based on the pros and cons of each technology as outlined in this article. However, if you decide to go with one and realize it’s not for you, you can always snapshot your instance and import it into the other platform.

Regardless though, both Lightsail and EC2 are very viable technology choices to host your compute infrastructure. What you decide to use will depend on what’s important to you as a user.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts