avniproject / avni-infra

Other
0 stars 0 forks source link

Optimize resource utilization (EC2, LBs, Network and RDS) for RWB #32

Closed himeshr closed 2 weeks ago

himeshr commented 1 month ago

Optimize resource utilization (EC2, LBs, Network and RDS) for RWB.

Step 1:

Perform analysis on cost saving as well as rsource utilization optimizations that could be done

Step 2:

Submit recommendations with information on

We'll review the recommendations and provide approval for specific changes

Step 3:

Implement approved changes. Perform any other follow-up activity needed, which was identified during analysis.

Balamuruganjeevi commented 3 weeks ago
  1. EC2 Instance Type Changes:

Change: After my analyses based on our current EC2 instance types and their utilization metrics. Consider switching to instance types family from T3 to T3a because both offers same performance the only difference is their processors. While T3 works on Intel and T3a works on AMD and i am not sure our application works flawlessly in AMD need to test and it offers lower cost than T3 type instances and performance is also offered same comopared to Intel, However it depends on our workload it is my consideration.

Impact: Positive impact on resource efficiency by aligning instances with workload demands. However, If its not fulfill our performance and worload and other needs may negatively affect performance. Need to test it if we decided to change type.

Cost-Savings: By using T3a family we can save upto 10% to 20% of cost.

Action Plan: Need to regularly monitor instance metrics. We can Perform certain load testing first to validate performance after instance type changes. And by analysing regularly in Future our needs increases have to change their types again to fulfill the requirements.

Follow-Up: Need to regularly monitor and adjust instance types based on changing workload demands.

  1. RDS Instance Optimization:

Change: After my analyses based on our current RDS instance types and their utilization metrics. Consider switching to instance types family from T3 to T4g like EC2 also the performance and all are same the only diffreence is their processors while T3 is works under Intel and T4g works under AWS Graviton both offers same performance. And i also nit sure about the performance and can work flawlessly under this processor and It offers lower cost than T3 type instances and performance is also offered same comopared to Intel, However it depends on our workload it is my consideration.

Impact: Positive impact is cost savings where negative impact depends on our workloads we have to implement and check first to know about the right performance.

Cost-Savings: Definitely a cost savings from 10% to 20% on the changes.

Action Plan: Need to regularly Monitor RDS performance metrics after changes happens. Regularly Analyze database workload patterns to determine optimal instance sizes and storage types. And analysing regularly in Future workloads changes have to change their types again also.

Follow-Up: After changing Instance types have to regularly review and adjust RDS instance configurations when needed based on our workload and database performance.

  1. Reserve Instances for Billing Discounts:

Change: Purchase Reserved Instances (RIs) for EC2 and RDS is a better way to reduce cost. where if we decided to change the instance types as mentioned above and need to again review about the RI instance types to works cost effectively, And we are not decided to change instance types then we can use RI instances as mentioned below

Impact: Positive impact on cost savings through discounted pricing.

Cost-Savings: For EC2 it will give 30% to 40% cost savings and for RDS it gives 20% to 30% cost savings compared to On-Demand pricing.

Action Plan: Need to Analyze historical EC2 usage to identify instances suitable for reservations. Utilize AWS Cost Explorer to forecast RI purchases.

Follow-Up: Regularly review RI coverage and adjust reservations based on changing usage patterns.

And however above all are just the recommendations to change the type of the instances, If we need better confirmation we need to implement it and testing it.

himeshr commented 3 weeks ago

@Balamuruganjeevi Have ready through your recommendations in the earlier comment.

Review Summary:

  1. EC2 Instance Type Changes to AWS Graviton or AMD: //No go
  2. RDS Instance Optimization to AWS Graviton or AMD: //No go
  3. Reserve Instances for Billing Discounts: //Proceed

Further optimization recommendations:

  1. Explore right-sizing of EC2 / RDS instances to other Intel Processor instance types based on Performance and usage metrics
Balamuruganjeevi commented 3 weeks ago

@himeshr Please see below comments:

For EC2 we are already in a cost efficient instance type based on our utilisation for Prod and staging servers and have some recommendations are here below

1t5j0y commented 3 weeks ago
Balamuruganjeevi commented 2 weeks ago

Activity pending:

1t5j0y commented 2 weeks ago

@Balamuruganjeevi why do we need so many RIs when we don't have these many instances?

Balamuruganjeevi commented 2 weeks ago

@1t5j0y Because we have overall of memory usage is 12 GB and we used to create RI with t3.nano and its memory storage is only 0.5 GB so to cover all instances as Reserved we have to purchase 24 RI with t3.nano instance type, so our current service quota limit is only 20 and i have purchased RI with 20 instances and still we need additional 4 instances to cover all on demand instances.

1t5j0y commented 2 weeks ago

ok. We could have purchased higher RIs for larger instances than t3.nano to avoid this.

Balamuruganjeevi commented 2 weeks ago

Ok, then decided to modify RWB EC2 RI to 12 t3.micro instances. Since there is only minimal amount of cost difference, So i think it will works.