Vertical scaling - change configuration on the fly.

0

Good day guys. Please help me find a solution. There is a task to implement a horizontal scaling project using Amazon tools and tools. There is a t2.micro server that processes requests from clients. Let's call it Web Server. The task is that if the load on it is more than 50%, it could automatically replace its configuration with t2.2xlarge, but at the same time, such requirements are mandatory conditions.

  1. Without interrupting your work
  2. Without losing connection with connected clients.
  3. Configuration replacement should be on the fly and all data should not be lost.
  4. It cannot be overloaded.
  5. Cost minimization whenever possible, i.e. autoscaling with horizontal expansion is not suitable due to additional costs.

It would be very good if it would be possible to leave the hard disk in working order with all the information and replace only the processor and RAM with more powerful ones. Also, I would like that when reducing the load on the server, its configuration would be returned back to t2.micro. Having studied a sufficient amount of information on autoscaling, I did not find a single solution, Amazon, that would suit me. Please help with advice and recommendations on how to implement my task using Amazon services.

4 Answers
1

You cannot vertically scale an EC2 instance while meeting those requirements. To change an instances size, it must be:

  1. Stopped
  2. Resized
  3. Started again

Can you please go into more details on why horizontal scaling is a cost issue? In your example, a t2.2xl is 32x the price of a t2.micro: https://aws.amazon.com/ec2/pricing/on-demand/

There is some loss from the additional OS overhead running on each new instance, but if you horizontally scaled an additional 3 t2.micros (or whatever size instance makes sense for your baseline load), then it would still be cheaper than vertically scaling to a 2xl

You can horizontally scale with an EC2 AutoScaling Group (ASG), here's a few caveats to keep in mind:

  • You'll need a way to route requests to the instances. While you could try something like DNS based routing to reduce costs, this doesn't really balance the load, since clients will cache requests. Generally using a load balance, like an ALB is recommended. At lower traffic levels, this would be similar in cost to 2 t2.micro instances
  • In production, you'll likely want to have unlimited mode enabled on your T family instances so that bursts don't bring down your application performance. Keep in mind that any borrowed CPU credits will be charged when the instance is terminated by the ASG. If your scaling on CPU usage, then you'll also want Unlimited Mode enabled to prevent issues with scaling based on the CloudWatch metrics (if the credits run out, the CPU metric won't go above the baseline)
AWS
answered 10 months ago
1

As per the other answer: vertical scaling can't be done in the way that you require; there will always be an outage. That's why it's better to design applications so that they can be horizontally scaled and so that they can deal with interruptions between the client and the server.

Taking a slightly different angle here: There are always going to be interruptions to service because (as Werner Vogels says) "Things fail all the time". If you have the flexibility to ensure that the application reconnects seamlessly (from the user's perspective) then you now have the opportunity to scale horizontally which is better all 'round.

profile pictureAWS
EXPERT
answered 10 months ago
0

Good day. Thank you very much for your recommendations. Analyzing Amazon services, I come to the conclusion that it is very bad that there is no way to change the configuration of the processor and memory, provided that all data remains on the hard drive and works. This is similar to hot swapping a hard drive with a different configuration. This would be an insanely cool thing for any company, not only in terms of financial savings, but also in terms of technology. Thanks again for the replies and recommendations.

answered 10 months ago
  • It would be very cool! The challenge is that most operating systems don't respond well to the amount of RAM changing dynamically while they are running. Expanding RAM would be relatively easy; shrinking it not so much. So if you were scaling vertically you'd still need to stop/start the operating system (even for a second!) and go through OS restart process (many seconds, possibly minutes). The network configuration also needs to be updated to move the local IP addresses to the "new" machine - and that takes time on the network for it to learn those changes. It's not as simple as "hot swapping a hard drive".

0

Thank you very much for your response. Okay, I'll try to describe the problem more precisely. I have an AWS Nitro Enclaves server and they have a c6in.4xlarge configuration for which my company pays $653.18 each monthly. The work they do is so critical and important that they cannot be replaced by cheaper ones or temporarily suspended. The need for such power is justified. Their work is very important and should not be interrupted, due to the fact that the load on them can be at any time. But there is another side, this is the time of their active loading. The percentage of unused resource - fluctuates around 90%. That's how I got the idea to do vertical scaling with auto-scaling and auto-scaling to a cheaper configuration. If you can suggest or give an idea for implementation, I will be very grateful to you.

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions