DEV Community

Cover image for Three ways to cost optimize AWS Compute
VijayaNirmalaGopal for AWS Community Builders

Posted on

5

Three ways to cost optimize AWS Compute

Welcome to another cost optimization series !!

AWS Compute is EC2 service that does compute & hosting of applications on cloud. These servers are placed in Region, Availability Zones and then provisioned into a VPC, Subnet isolation and enables us to connect via ports through security groups definitions. Organizations/People rent the server on cloud either on-demand, reserve the instances for business utilization.

Well, that being said, vital point that helps us in cost optimization is stopping the servers, when they aren't used or when there aren't any workloads running. This will help in saving money invested and there are 3 ways of doing that for compute services

Tip 1

Start & Stop
Options are provided from AWS EC2 console and other ways are to use API, SDK, AWS CLI commands to start & stop the servers

Tip 2

AWS Lambda & AWS EventBridge

With AWS Lambda, it is both simple & easy to write python scripts for stopping & starting servers, based on tags(Key, Values). Tags basically, helps AWS Lambda functions to identify the servers to be stopped or started, accordingly.

So the second part is on what frequency this lambda function has to be executed so that the servers are identified for start/stop operations. Here comes, AWS EventBridge cron tab scheduler options where each lambda, can be triggered say evening 6PM daily or every Friday or Monday, as needed. This ensures that functions are triggered and servers are taken care of.

Refer at Link

Tip 3

AWS Instance Scheduler
Finally, fully automated, easy to deploy, configure, AWS provided custom solution is AWS Instance scheduler, which uses lot of services other than AWS Lambda, AWS SNS etc to perform the same stop/start activities on EC2. To know further, please visit AWS Documentation at Link

Go with any option that best suits your business needs !!

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Create a simple OTP system with AWS Serverless cover image

Create a simple OTP system with AWS Serverless

Implement a One Time Password (OTP) system with AWS Serverless services including Lambda, API Gateway, DynamoDB, Simple Email Service (SES), and Amplify Web Hosting using VueJS for the frontend.

Read full post