Skip to content

How do I optimize SQL Server licensing costs on my Amazon EC2 instance?

7 minute read
0

I want to know best practices to manage costs for SQL Server licensing on my Amazon Elastic Compute Cloud (Amazon EC2) instance.

Resolution

Important: The following resolution provides general best practices for SQL Server licensing. Make sure that you also check your specific licensing requirements before you implement changes.

Choose the correct licensing model for your workload

For EC2 instances, you can either use an Amazon Machine Image (AMI) with the SQL Server license included, or bring your own license.

Use a license-included AMI

Use license-included AMIs for variable workloads, short-term projects, and situations that require flexibility across instance types. This option is also easier to use if you don't already have an SQL Server license. With license-included deployments, Amazon EC2 automatically manages licensing compliance. You don't require client access licenses. For information about the price and requirements of license-include AMIs, see Cost impact.

Bring your own license

Use the bring-your-own-license (BYOL) model if you already have existing SQL Server licenses and plan to run large, predictable workloads. With BYOL, you must manage the license compliance yourself.

With BYOL, you can either choose BYOL with License Mobility through Software Assurance or BYOL on Dedicated Hosts. License mobility reduces instance costs. You can bring products with license mobility, such as SQL Server with Software Assurance, to either shared or dedicated tenancy.

Use BYOL with License mobility through Software Assurance for the following scenarios:

  • You have SQL Server licenses with active Software Assurance.
  • You require flexibility on instance type or tenancy.
  • You must manage licensing or use your existing licenses.

For more information, see License Mobility through Software Assurance on the Microsoft website.

Use BYOL with Dedicated Hosts for the following scenarios:

  • You have SQL Server licenses without Software Assurance that you purchased before October 1, 2019.
    -or-
    You added the SQL Server license as a true-up under an active Enterprise Enrollment that was effective before October 1, 2019.
  • You have stable and predictable workloads that run most of the time.
  • You have regulatory requirements for dedicated infrastructure.

For more information, see How to save 45% on licensing costs by migrating and optimizing SQL Server on AWS.

Choose your SQL Server edition

Before you choose your SQL Server edition, compare the available editions. Make sure to assess features against your requirements. For example, SQL Server Standard edition is more cost-effective than SQL Server Enterprise edition. However, SQL Server Standard edition has a maximum compute quota of 24 cores of 4 sockets for each EC2 instance.

Where possible, downgrade to SQL Server Standard edition and use SQL Web edition for public workloads.

For all nonproduction environments, such as development, QA, testing, staging, and UAT environments, use SQL Server Developer edition. You can't use SQL Server Developer edition for production data or environments that serve customer workloads. After you download SQL Server, you can use shared tenancy to install SQL Server Developer edition on EC2 instances. SQL Server Developer edition doesn't require dedicated infrastructure.

Consolidate your databases

If you run multiple separate EC2 instances for each database, then consolidate your databases where possible. Consolidate the database onto fewer, larger EC2 instances to reduce licensing costs. Make sure to design your architecture with availability and fault tolerance.

Note: If you have databases with conflicting compliance requirements, workloads that require performance isolation, or different availability requirements, then don't consolidate those databases.

Use passive replicas

For high availability deployments that use Always On Availability Groups or Failover Cluster Instances, use passive secondary replicas to reduce licensing costs. A passive secondary replica is a standby EC2 instance that you use only for disaster recovery. This EC2 instance doesn't accept read traffic or active workloads.

For license-included workloads only, you can use Amazon EC2 High Availability on SQL Server to automatically manage passive replicas. For these passive replicas, you only get billed the Windows Server and Amazon EC2 compute costs, not the SQL Server license. Make sure that you adhere to the Amazon EC2 High Availability on SQL Server requirements. For implementation steps, see Getting started with Amazon EC2 High Availability for SQL Server.

For BYOL EC2 instances, use licensing for passive failover. To use passive failover, you must have SQL Server licenses with active Software Assurance

Important: All EC2 instances require Windows Server licensing.

Choose the right instance size

Important: The minimum number of vCPUs for billing is 4. SQL Server Standard edition has a maximum of 24 cores (48 vCPUs).

To make sure that you choose the right EC2 instance size for your workload, take the following actions:

  • (BYOL EC2 instances only) If you use Microsoft's per-core or per-socket licensing model, then the reduce the number of cores that you require.
  • Check your CPU, memory, and input/output operations per second (IOPS) usage metrics in Amazon CloudWatch to validate that your EC2 instance type meets your usage needs.
  • Use AWS Compute Optimizer to receive automated right-sizing guidance.
  • If your EC2 instances consistently run below 40% usage, then reduce the instance size.
  • Test smaller EC2 instance types in test environments before you use them in production.
  • If you have a variable workload, then use a burstable performance EC2 instance.
    Note: The 4-vCPU minimum for billing still applies.

For more information, see How do I choose the correct EC2 instance type for my workload?

Reduce your CPU usage

To lower licensing costs, deactivate simultaneous multithreading or reduce core counts. These configuration changes are useful in the following scenarios:

  • You want to reduce vCPU count but keep memory and storage.
  • You use memory-intensive, CPU-light workloads.
  • You want to reduce your core-level licensing costs.

Use metrics in CloudWatch to identify underused and overused resources.

Use Savings Plans

Use Savings Plans to reduce compute costs for predictable SQL Server workloads. It's a best practice to use Savings Plans for steady-state SQL Server EC2 instances that run continuously or for production databases with predictable usage.

Note: For development or test environments that stop during off-hours or workloads that you plan to migration to other platforms, it's not a best practice to use Savings Plans.

Use the AWS Pricing Calculator

Use the AWS Pricing Calculator to better understand licensing costs for your configuration and compare costs across the following factors:

  • License-included compared to BYOL
  • Different SQL Server editions
  • Estimated Dedicated Host expenses
  • Savings Plans savings

Note: The price difference between an EC2 Windows instance with SQL Server and a Windows-only EC2 instance is the SQL Server licensing cost.

Track and manage SQL Server licenses

To track your SQL Server licenses and maintain compliance, use AWS License Manager to create a self-managed license.

Note: Self-managed licenses in License Manager are for tracking and inventory purposes only. All licenses that you configure within the operating system are considered BYOL, regardless of whether you registered the license in License Manager.

To automatically identify optimization opportunities, use AWS Trusted Advisor. For SQL Server licensing, you can run the Amazon EC2 instances consolidation for Microsoft SQL Server and Amazon EC2 instances over-provisioned for Microsoft SQL Server checks.

You can also use the AWS Optimization and Licensing Assessment (AWS OLA) to assess and improve your environment.

Use the Cost Optimization Hub

Use the Cost Optimization Hub to receive automated cost optimization opportunities. For more information, see Optimize SQL Server licensing by using Compute Optimizer.

Related information

Understand licensing options and considerations for Microsoft SQL Server on Amazon EC2

Understand SQL Server licensing

Microsoft licensing on AWS

AWS OFFICIALUpdated 2 months ago