Posts
-
Mining on AWS: A small update
This is a post from the old blog, which I have not edited in any way. Your results may vary - the conclusions here came from prices circa 2013.
In light of the recent massive jump in Litecoin prices, I’d like to share some amusing facts.
Thanks to Facebook friends, it turns out that the g2 instances are more efficient at mining Litecoins. Running both cudaminer and 4-threaded cpuminer gives a total of around 170 kH/s, which is around half the hashing power of the cg1 instance for a quarter the cost. Additionally, spot instance prices for g2 are currently very stable at $0.075/hr, and are available in both N.Virginia and Oregon, instead of just N.Virginia.
Given this more efficient mining, and the current Litecoin price of roughly $20/LTC, and assuming a 1% pool fee, the estimated AWS -> LTC exchange rate is
$0.815 in AWS costs <-> $1 in LTC
That’s right, mining on AWS is currently profitable!
Some caveats:
-
The price of LTC is very volatile. That it doubled in price in a single day should be proof of that. There is no guarantee it will stay profitable for very long. Litecoin prices could crash the next day and it wouldn’t even be that surprising.
-
You are at the mercy of how lucky your mining pool is at getting a block. The pool I’m using has averaged around 110-120% of expected time per block, which brings me to almost dead even. Additionally, the high prices are bringing in more miners, so the difficulty is going to rise, which will also bring expected profit down.
-
The fees for exchanging LTC to USD are 2% at BTC-e, the most popular Litecoin exchange. Overall this doesn’t mean much, but if you need to continually convert LTC to USD to feed back into AWS, it’s 2% less money going through the loop.
-
For g2 instances, you are limited to 10 spot instances per region, giving a maximum of 20 instances. So unfortunately, you can’t abuse EC2’s ridiculous scalability, because Litecoin mining is only profitable at the spot instance price. Assuming you max out on instances, the mining calculator gives 2.28 LTC/day, which works out to expected $10/day in profit.
-
If more people start asking for spot instances, the price will rise and profitability will go away. Given the current situation, this might happen very soon.
Personally, I’m planning to run as many instances as I can manage to get. No matter how fleeting this might be, it’s hilarious that AWS mining is currently profitable, and I intend to abuse the situation while it lasts.
-
-
Spending AWS Credit In the Silliest Way Possible
This is a post from the old blog, which I have not edited in any way. Your results may vary - the conclusions here came from prices circa 2013.
Last year, thanks to various giveaways at events, I got $450 of Amazon Web Service credits. I redeemed them on my account, and left them there.
Fast forward to now. The credits I redeemed last for a year. So, if I don’t spend them by mid-February 2014, they’ll disappear forever. I don’t have anything I need to scale, and I’m certainly not running any data analysis that would help from having lots of EC2 credit. What I can do, however, is mine some Litecoins.
To set up Litecoin mining on Amazon EC2, I mostly followed this link, which is a post about mining with Amazon’s GPU instances. It’s fairly comprehensive, although somewhat outdated.
First, I downloaded the Litecoin client (off here) to get a Litecoin address, and made an account on a mining pool. I ended up using Coinhuntr, mostly because their interface looked nice, but you can pretty much choose whatever one you want.
Next, I made a Spot Instance request in the N.Virgina region. This is the only region which lets you make spot instance requests for cg1 instances, which are the ones that have 2 Nvidia Tesla M2050s for use. The spot instances are $0.346/hr, versus $2.1/hr for on demand instances, which means the mining is a lot cheaper. I used Ubuntu 12.04 for HVM as my AMI. Ubuntu 12.04 is one of the few supported distributions for Nvidia’s CUDA Toolkit, which you need to mine, and GPU instances are only available for HVM.
From there, I followed the EC2 mining link above, with some minor changes.
- I needed to install the libtool package, which for some reason wasn’t listed in the packages to download from the script above
- I downloaded the CUDA toolkit that corresponded to Ubuntu 12.04.
- I used cudaminer instead of cgminer. Cudaminer is designed around Nvidia’s hardware, whereas cgminer is designed around OpenCL. Both work, but cudaminer gives better performance on Nvidia cards. (If you’re planning on using cgminer, watch out that you need version 3.7 or lower, as cgminer stopped support GPU mining on 3.8.)
Because I’m working on spot instances, I made a quick shell script to run through all the required installations and setup, in case the instance goes down. You can look/download them at http://pastebin.com/k9akQxzX and http://pastebin.com/1DbyrWr1.
Update: I also downloaded cpuminer, to take advantage of the two Intel X5570s on the cg1 instance. I downloaded from here, it worked out of the box for me. I’m running cpuminer on 8 threads out of 16. Cudaminer needs a CPU as well, so to be safe I’m giving an entire processor to it.
With both cpuminer and cudaminer running, one cg1 instance performs at roughly 340 kH/s. Given the current exchange rate, and assuming spot instances stay at $0.346/hr, the final AWS credit -> LTC exchange rate is
$3.977 in AWS credit <–> $1 worth of LTC
All in all, this is a surprisingly decent exchange rate. It’s nowhere near profitable, but suddenly all those AWS credit codes seem a lot better.