Ethereum mining in Azure
The cryptocurrency craze is real, with BitCoin and other currencies surging in recent months. While the long-term viability of these are questioned by some, cryptocurrency mining has been going on for years and is the catalyst for how coins are distributed.
Personally, I’ve mined cryptocurrency at home with my own ASIC and GPU equipment, but I’ve always wanted to test the viability of mining in the cloud. There are already several sites that sell out hashing power to buyers looking to mine cryptocurrency, and there are plenty of sellers willing to lease out their compute power to do so.
BitCoin and several other cryptocurrencies can be mined through varying methods, but ASIC mining is most efficient when available for a particular coin.
GPU mining can be especially profitable on cryptocurrencies that are ASIC-resistant (where ASIC mining is not allowed in an effort to avoid a hardware arms race).
CPU mining is barely a blip on the radar, as it is the least efficient method for cryptocurrency mining.
So how does this tie into Azure? About a year ago, Microsoft announced N-series virtual machines that actually have a healthy amount of GPU power.
Using Power BI, R and Azure to visualize car sharing services
These instances are particularly useful for certain applications like 3D rendering, artificial intelligence, medical research, and CUDA-intensive computing. GPU’s are much more powerful than what CPU’s can do in these scenarios because of the type of algorithms they can run.
These same algorithms can be used for hashing power to mine cryptocurrency quite well.
Running this in Azure isn’t particularly difficult and is exactly the same method as running it in-house, but I do want to test the best case scenario to evaluate the profitability of running mining operations in Azure.
First, we need to look at what GPU’s are available in Azure. At the time of this posting, there are two GPU’s available to use with N-series instances in Azure – NVIDIA Tesla K80 and Tesla M60.
Since the M60 (NV SKU) is the more recent generation, we will be testing with those.
The NV instances include the following SKU’s:
Spinning up these instances in Azure is simple enough, but what cryptocurrency variation will be most profitable? I like to use a site called whattomine.com, which actually compares the mining profitability of cryptocurrencies by factoring in several variables like market value, mining difficulty, power consumption, and your specific hardware.
This is incredibly useful info when looking for what to mine.
For this test, we will evaluate two of the most profitable cryptocurrencies available (at the time of this post) that use two different mining algorithms – MonaCoin, which uses the Lyra2RE2 algorithm, and Zencash, which uses the Equihash algorithm. Both of these algorithms are designed for NVIDIA hardware, which suit our Azure instances well.
To mine MonaCoin, we will use a miner called CCMiner; for Zencash, we will use a different miner called Zec Miner.
How to mine Altcoins on MinerGate using Azure Cloud Services in 10 minutes
Though these cryptocurrencies may provide little value to you, they can always be traded for your coin of your choice on several online exchanges. And yes, USD is included if fiat money is more your style.
In Azure, we will deploy a Windows Server VM in the West US 2 region.
You can find regions that support N-Series instances through Microsoft’s regional availability site. If you have trouble finding the NV SKU, try switching your storage type from SSD to HDD. Be sure to monitor your usage closely since this SKU gets rather expensive.
I have deployed a simple NV6 Windows Server 2016 instance for this test.
This size has one M60 GPU attached, so it should be straightforward to gauge performance.
More efficient crypto mining in Azure
SKU’s with multiple GPU’s are available but scale up pretty evenly in mining performance.
Once the VM is deployed, download and install the latest NVIDIA drivers for the Tesla M60 – they do not come installed by default.
From here, you simply run your cryptocurrency miner using the same string you would use normally.
This string will vary depending on your mining pool, algorithm, and username, but they generally look something like this:
- CCMiner: ccminer -a lyra2v2 -o stratum+tcp://miningpool.com:2995 -u username -p password
- Zec Miner: miner.exe –server miningpool.coim –user username –pass password –port 3618
And now… the results.
For the MonaCoin/Lyra2RE2/CCMiner test, the NV6 SKU was able to mine at a respectable 21Mh/S.
At current market rates, this would result in a payout of around 4.8 MonaCoins/month, or about $66/month – far below the $1004/month for the Azure VM.
Comparatively, a single NVIDIA GTX 1080 TI GPU would mine MonaCoin at around 63MH/s.
At current market rates, the 1080 TI GPU would result in a payout of around 14 MonaCoins/month, or about $202/month.
For the ZenCash/Equihash/Zec Miner test, the NV6 SKU was able to mine at 285 Sol/s.
At current market rates, this would result in a payout of around 2.2 Zen/month, or about $71/month – again, far below the $1004/month for the Azure VM.
Comparatively, a single NVIDIA GTX 1080 TI GPU would mine ZenCash at around 730 Sol/s.
At current market rates, the 1080 TI GPU would result in a payout of around 5.6 Zen/month, or about $182.44/month.
Here’s all the results neatly compiled into a table.
As expected, the hash rate of the NVIDIA Tesla M60 running in Azure is far too low to pay for the NV6 instance size – you would lose around 80-90% of your investment to the Azure subscription cost.
This could be due partly to mining algorithms being optimized more towards consumer GPU’s, as the M60 and K80 are designed for workstation loads.
Unless you have some free compute to burn through in Azure, I wouldn’t recommend using these SKU’s for *profitable* cryptocurrency mining. A better investment would be to buy hashing power directly from those willing to sell it, acquire your own mining hardware, or just buy the cryptocurrency instead in hopes of future gains.
But hey, it was fun to set up!