Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I was wondering which would be better, to host a site on EC2 with many micro instances, or fewer larger instances such as m1.large. All will sit behind one or a few larger instances as load balancers. I will say what my understanding is, and anybody who knows better can add or correct me if I'm wrong

The main reason for choosing micro instances is cost. A single micro instance on average will give around 0.35ECU for $0.02/hour, while one small instance will give 1ECU for $0.085. If you do the math of $/ECU/hour, a micro instance works out to be $0.057/ECU/hour, whereas for a small instance it's $0.085/ECU/hour. So for the same average computing power, choosing 100 micro instances would be cheaper than 35 small instances.

The main problem with micro instances is the more fluctuating performance, but I'm not sure if this will be less of a problem when you have many instances.

So does anybody have experience benching such setups and see the benefits and drawbacks? 

1 Answer

0 votes
by (44.4k points)

Check out this official documentation for a detailed version - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-lost-key-pair

Or Follow these steps:

1. Stop the running EC2 instance

2. Detach /dev/xvda1 volume (let's call it volume1) 

3. Start a new t1.micro EC2 instance, using your new key pair. Create it in the same subnet, if not you’ll have to terminate the instance and create it again.

4. Attach volume1 to the newly created micro instance, as /dev/xvdf (or /dev/sdf)

5. SSH to the new micro instance and mount volume1 to /mnt/tmp

$ sudo mount /dev/xvdf1 /mnt/tmp

6. Copy ~/.ssh/authorized_keys to /mnt/tmp/home/ubuntu/.ssh/your_keys

7. Logout

8. Terminate micro instance

9. Detach volume1 from it

10. Attach volume1 back to the main instance as /dev/xvda

11. Start the main instance

12. Login as before, using your new .pem file

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories

...