Would this ‘pay as you go’ cloud mining model compare with a half decent mining rig with GPU and the constant power  draw?

ZCash is a crypto currently that uses cryptographic zero-knowledge proofs (zk-SNARKs) to protect both the amount and recipient of shielded transactions.   This offers several advantages over the more BitCoins.  Another feature of ZCash algorithm is that, unlike Bitcoin, the proof of work is not well suited to FPGA implementation.

Mining bitcoins is not really worthwhile these days unless – you use dedicated FPGA hardware and have access to ‘free’ power.  ZCash redresses the balance somewhat by really only being implementable on CPU/GPU based systems.

I never considered using cloud compute would ever be worth while in using it for mining, but with the introduction of AWS spot pricing, would these cheaper prices enable you to take advantage of the lower cost and be able to turn a profit?

 

Here’s my brief overview

I haven’t shelled out on decent GPU hardware.  So for comparative hardware performance and sol/s I’m using the info in this fine article.

My Basic premise is to create an AMI image that I can start on demand when the price is low enough, and use the best miner software to generate zcash.

Point learned:

  • the 2 GPU based instance I’m testing are g2.2xlarge and p2.xlarge.  THe former has K520 GPU and the p2.xlarge has K80.  Both nvidia CUDA chips
  • nheqminer CUDA doesn’t run on the AWS instances. Only CUDA devices with SM 5.0 and higher are supported.
  • EWBF uses the chips, but doesn’t utilise the CPU. If I’m paying by the hour, then I want to use the max I can get.
  • So I run both.  EWBF leveraging the GPU and nheqminer for CPU

Firstly build the AMI image.   Based on Ubuntu 16.04 image.

RUn this shell script to set up the machine.  Note that I am not compiling the miner sw locally.  Just using the prebuild images.


#!/bin/bash

sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo sh -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
sudo apt-get update && sudo apt-get install -y --no-install-recommends --allow-unauthenticated linux-headers-generic dkms cuda-drivers unzip

 

cd /home/ubuntu
wget https://github.com/nanopool/ewbf-miner/releases/download/v0.3.4b/Zec.miner.0.3.4b.Linux.Bin.tar.gz
tar -xzf Zec.miner.0.3.4b.Linux.Bin.tar.gz

wget https://github.com/nicehash/nheqminer/releases/download/0.5c/Ubuntu_16_04_x64_cuda_djezo_avx_nheqminer-5c.zip
unzip Ubuntu_16_04_x64_cuda_djezo_avx_nheqminer-5c.zip
chmod u+x nheqminer_16_04

This does 3 things

  1. Install nvidia cuda drivers and a couple of additional packages
  2. Downloads and unpacks EWBF miner
  3. Downloads and unpacks nheqminer

This is all done as the default ubuntu user.  We don’t want to be running this code as root.

So now we need to make sure the miners are configured and start on boot. (I presume at this point you’ll have a mining pool login)

Save this file as awsstart.sh into ubuntus home directory and make is executable (chmod u+rx awsstart.sh)


#!/bin/bash

die() { status=$1; shift; echo "FATAL: $*"; exit $status; }
EC2_INSTANCE_ID="`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id || die \"wget instance-id has failed: $?\"`"
SERVER="zec.slushpool.com"
USER="YOURUSER"
PASS="x"
PORT="4444"

./miner --server $SERVER --user $USER.$EC2_INSTANCE_ID --pass $PASS --port $PORT --log 2 &
./nheqminer_16_04 -l $SERVER:$PORT -u $USER.$EC2_INSTANCE_ID -t 6 > nheqminer.log

replace SERVER and USER with yours.  The idea here is that we use the AWS instance ID for each machine as the worker id.  enabling you to identify the running instances and what work they are doing without resorting to logging in to the servers themselves.

In order to start then we also need to modify rc.local.  Year I could have created a whole systemd setup,  but this is quick and repeatable

Add this single line to /etc/rc.local


su - ubuntu -c '/home/ubuntu/awsstart.sh'

Reboot the instance and check that the miners start up.

When all is well, use this and create your own AMI image based on this.

 

Then set up your “spot requests”.

Look at the pricing history, but you should be able to get instances for ~$0.265 per unit where the On-Demand pricing is $0.90 (p2.xlarge).  The g2.2xlarge has a cheaper on demand price ($0.65, but the spot price, whiles it does drop to ~$0.26 at time tends to sit higher)

Looking at the hashing rates between the instances was well

  • p2.xlarge: Total speed: 97 Sol/s from EWBF and ~10 Sol/s from nheqminer.
  • g2.2xlarge: Total speed: 57 Sol/s from EWBF and ~10 Sol/s from nheqminer.

So whilst the p2.xlarge have higher on-demand rate, the spot pricing tends to actually make it cheaper to run.

 

 

So, the million dollar question – is it worth it?

 

In a nutshell.  No.

Racking up about us$14 per day in spot price instances. then estimate rate of return in slushpool is 0.01046166 ZEC.  That equates to about us$3 at current exchange rate  (1ZEC == 289USD).

So whilst it’s an interesting exercise, then unless the exchage rate is around us$1500 or higher – then you are not going to break even.

 

 

 

 

ZCash, Cloud and AWS spot pricing

2 thoughts on “ZCash, Cloud and AWS spot pricing

  • 2017-08-01 at 3:40 pm
    Permalink

    AWS have recently released the g3 spec instances.
    These have K520 cuda devices and 16cpu, and also support AVX2 extensions. Same test.

    g3.4xlarge: Total speed: 173 Sol/s from EWBF and ~23 Sol/s from nheqminer. ( t = 12)

    so getting about 200Sol/s for about 32c an hour on spot pricing

    and at current block time and network hash rate you are still looking at spending 30c to gain 3c (ZEC = $175USD). So no, don’t do this if you want to make money.

  • 2017-10-27 at 12:47 pm
    Permalink

    AWS have recently released the p3 instances
    These have the Tesla V100 cuda devices and 8 e5-2686v4 cpu and 60Gb RAM in the p3.2xlarge flavour

    Temp: GPU0: 50C
    GPU0: 964 Sol/s
    Total speed: 964 Sol/s

    So, around 1000 Sol/s for about 42c an hour on spot pricing.

    at current block time and network hash rate and exchange rate (ZEC = $230USD), then we’re spending about $10 per day for a return of $7 a day.

    Closest yet, but still not a profitable exercise

    (running the p3.8xlarge with 4gpu, is fast (~3800Sols/s) but still not worth it – spend us$10 to get us$6)

Comments are closed.