Amazon Free Tier and Ec2 instance

@jeremy @rachel
I am using amazon free tier and i have 750 free hours for computing on EC2, however, i got a billing report today for the month of January.

I read a post from https://www.linkedin.com/pulse/guide-amazons-aws-lazy-deep-learning-researcher-guy-reiner on reducing this,(although its a bit outdated) any other pointer on this?

1 Like

Ouch. The P2.xlarge is not free as you probably know (we use it for the faster GPU). I found this link which explains the EBS and elastic ip charges. You could remove the extra IPs and make sure the EBS (data storage) shuts down after killing the instance.

http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/checklistforunwantedcharges.html

I had exactly the same issue when starting this course and since then I have switched to spot instances because otherwise bill is growing fast. Especially when the instance is running but also when stopped, due to the reserved volumes and IP-adresses as @Will noted.
It is a bit more effort to use spot instances, but I think it is worth it in order to control charges. Here I made a description of how I set it up and then terminate it after every use:
http://forums.fast.ai/t/thoughts-on-spot-instances/156/21

2 Likes

Elastic IP lets you keep the same IP all the time, but you will be charged as long as you own the IP even if your instance is offline. This is not included with free tier and will run just under $7 an ip per month. You can use an ip that changes everytime you start/stop an instance for free. The elastic IP is a time saver but will cost you money and is usually most important if you are providing services to the outside world and need a fixed IP or just don’t want to keep changing IPs.

GPU Instances (the only reason to even use AWS for machine learning) are not included in the free tier and are $0.90/hr.

SSD storage you only get 30GB and it looks like you are using 215GB over the amount you get with the free tier.

There is not much you can do as you did use the resources, but you should turn off what you don’t want to use moving forward. You probably already have charges for Febuary.

Actually the elasticip address is free as long as it is attached to an instance and the instance is running. You are only charged whilst you retain an address but are not using it.

I think the main use of the elastic IP is so that you can shut down, and start up later and go to the same location in your web-browser. This makes it dead simple to get to your ipython notebook.

However, Rachael merged my extra alias in aws-alias.sh. Check it out here:
https://github.com/fastai/courses/blob/master/setup/aws-alias.sh

So now you can do these steps to bring up your notebook

aws-get-p2 # get your p2 instance
aws-start  # start your p2 instance
aws-get-ip # get the ip address
aws-nb     # open your browser to whatever IP you happened to be assigned.

So… go ahead and delete your elastic IP if you don’t want to pay the extra $5/month or so.

On the other hand… I just went and bought a GTX 1070 from newegg and shoved it into my desktop. It kind of fit with only a little interference. The cost was $400 on newegg. If I continue with deep learning, it’ll be much less expensive than AWS. If I don’t, I can sell it on ebay for about $350. So… either way, it’s less expensive than AWS if you already have a desktop with a decent processor.

-Caleb

Buying one is OK for now but what about if you later want to run a deeper model or more data on multiple GPUs? For this reason there is a benefit in understanding AWS.

I have been using spot instances which are only 18c an hour; and with a persistent volume which contains the cats/dogs data.

However I am sure there must be a way to put docker files on the attached volume. Then changes to programs and settings would all be persisted as well. Anyone else done this?

AWS provide a service called opsworks. This is basically a configuration management tool called chef. You can write recipes to install the software or to use docker…

See https://aws.amazon.com/opsworks/

I now have a 1080 card so don’t use AWS much. However if I do, this would be the approach with the spot instances. I too got stung for an instance I didn’t even have running, just the ebs and elastic ip I forgot! Probably worth putting some warnings for new users…

1 Like

Any thoughts on performance difference between AWS and say a 1080?

For example if this resource is correct it would indicate that a k80 is significantly faster than a 1080. https://www.microway.com/knowledge-center-articles/comparison-of-nvidia-geforce-gpus-and-nvidia-tesla-gpus/

It seems like the performance difference (if true) gets lost in the conversation? If you using XYZ service gives say a 5x 10x 20x etc. performance boost over say buying a GPU, it’s not really an apt comparison?

I am having an issue with the elastic IP addresses even though I don’t have any instances present in my dashboard or which is non terminated, but they are still charging me 0.005$ per hour. I don’t even have an elastic IP address assigned to me as the instance is gone (deleted the instance). Could you please give me an insight as to what is happening?

Generally you need to look at your billing information to realize where costs occur (https://console.aws.amazon.com/billing -> Bill Details). In my experience I usually pay for running instances (of course) and for Volumes.
One issue I had is some Volume hanging on which I did not intend to keep. The spot instance concept I am using requires that one volume is kept - the one named “spot” - which holds the data between spot instances. This incurs a small monthly fee and I pay one or two dollars a month to keep this volume.
Make sure any unwanted Volumes are deleted. You also pay more if Volumes are attached then if they are detached. If you really do not need the “spot” Volume for some time you can create a Snapshot of it and delete the Volume. When you need it again you can recreate the Volume from the Snapshot . This operation however can take hours so it is not for day to day use but you pay less for the Snapshot.
You can let me know if this is your issue or if you have something else in your bill.
Best regards
Jonas

1 Like

Thanks for your response Jonas. I actually contacted the AWS people and they sent a mail regarding it and credited me with the unwanted charges.I was actually lucky enough to see the bill now and then. Now regarding the EBS what is the ideal way to use so that the cost doesn’t become too much. As an undergrad student and newbie to AWS cost really concerns me a lot.
You can actually view my billing details here, this was taken after the instance was terminated.

console.aws.amazon.pdf (89.5 KB)

I am not sure why you have “Elastic IP address not attached to a running instance”. Have a look at Elastic IDs in your console and delete those you do not use. You do not need them

Elastic IP address was there but the instance was not there so I was not able to delete the unwanted elastic IP address so was being overcharged. Got the conflict resolved.