Apollo
Apollo

Reputation: 9054

Serving up webpage from Amazon EC2 instance

If I'm serving up a website using apache from an Amazon EC2 instance, does it ever make sense for me to stop the machine? Also, I'm extremely new to EC2 so I'm not entirely sure how EBS works. It looks like Amazon does gave me 8gb of storage for free, but am I actually being charged for that storage 24/7? Thanks

Upvotes: 0

Views: 322

Answers (4)

ArxXx
ArxXx

Reputation: 3

If you need more computing power and have a bigger instance, you could have the instance running on a higher CPU rate (more expensive instance type) for those hours the site is going to be accessed a lot and after that just change the instance type back to some minor. Just don't mess with the volumes. If you don't want to be offline for those couple of minutes you're going to need, you could set up a free (micro) instance and assign the elastic IP to that instance or even redirect to a static web page on s3... example: redirect to a s3 static page with "Maintenance in progress" message displayed.

Also, watch out while stoping/terminating your instance, I dont know is that the case just on windows instances but after starting instance again my non-root drive (volumes for non system partitions) went offline (when checking "volumes" they were attached) so I had to mount them again.

Upvotes: 0

Nishant
Nishant

Reputation: 55856

does it ever make sense for me to stop the machine?

For production machine, no. I never had to stop prod machines in last couple of years. We launch new machines from our AMI when required and kill them when not.

However, for load testing or some research work for clustered environment -- we had to pause machines for a while. We use stop feature at that time.

...I'm not entirely sure how EBS works.

Quoting from official doc:

Amazon EBS volumes are off-instance storage that persists independently from the life of an instance. Amazon Elastic Bionlock Store provides highly available, highly reliable storage volumes that can be attached to a running Amazon EC2 instance and exposed as a device within the instance.

So, in highly simplified terms, it's like an external HDD or NAS

It looks like Amazon does gave me 8gb of storage for free, but am I actually being charged for that storage 24/7?

If you're paying for the instance... it should include the cost of the storage that AWS provides. For a given instance type, EBS backed instances cost more than Instance Store ones, so I guess it would include the EBS cost, but it's their pricing policy -- I can't really comment.

Side Note

Being a network storage, EBS backed images have its pros and cons. The biggest benefit is, if instance ever crashes, your root device would not vanish (please make sure you have checked 'do not delete root device on termination' while creating the instance). It comes handy in times of hardware failures or accidental termination.

However, being on network, it has all the issue that any networked device can have. For some applications that has really really fast and excessive IO (like for Cassandra), EBS seemed to be a bad idea.

Upvotes: 1

gview
gview

Reputation: 15361

If you stop the server, it is down. If you're in a development stage, and you want to limit your costs to the bare minimum, yes, you can stop the server at the end of each day. This is one of the advantages to an EBS backed instance.

EBS is basically external network attached storage. For most people, EBS backed servers are the way to go, since you can easily clone them, stop and start them, etc. You can also make snapshots of an ebs volume, so it's a great way to have low cost backups of your server.

As for EBS storage, yes you pay for it, but it is relatively inexpensive. The real cost of EC2 ends up being CPU/runtime for the most part, although EBS certainly makes it easy to use up large amounts of storage.

Upvotes: 1

MK.
MK.

Reputation: 34517

If you have a free instance (it has to be a micro instance running their brand of EC2 Linux, not, say CentOS) then there is no reason to turn it off. If you are paying per hour, then yeah, it makes sense to shutdown when not in use.

Upvotes: 0

Related Questions