AWS CPU Mining Cryptonote Profitability

We have explored the profitability recently of GPU coin mining on Amazon Web Services (AWS).  But GPU mining is not the only way to get coins.  Hey, what about CPU mining?

Glad you asked!  There are some cryptocoins that are created to be CPU mined.    The coin currently that is slipping in and out of most profitable is Webchain.  Webchain has developed its own cryptonight alogrithym specifically targeted at CPU mining called CryptoNight-Webchain.  The algorithm seeks to not only be CPU mineable but also deter GPU and ASIC mining.  In other words, focus on delivering a coin mineable by just about any CPU on any device.

The Experiment

Determine if CPU mining in AWS could be profitable.  Find the best combination of low cost, CPU power, and coin return.

Setup

As mentioned earlier, the test mined Webchain coin.  The choice of Webchain was that it is specifically CPU mined and is one of the most profitable CPU mined CryptoNight coins.  

I used webchain-miner to mine Webchain coin. This miner was selected as it is the miner Webchain created and suggests.  Also, the miner is easily available and comes in several OS versions.  The version used was the 2.6.2.0 linux amd64 miner.

The OS platform was Ubuntu 18.04.  The OS was setup as I explained here.  The webchain-miner application was downloaded from releases so no compiling was needed.

The webchain-miner was configured to use pool.webchain.network:3333 (variable difficulty) with no specific CPU configuration.  Testing was across several types of instances with differing CPU.  Because of this, CPU configuration was left as default or not set.

Finally, in order to auto run the webchain-miner when it loads the following was added to /etc/rc.local:

#!/bin/sh -e
cd /home/ubuntu/webcpu
./webchain-miner

Testing

AWS has many instance types with viable CPU configurations.  To reduce the test base we made the first cut as we would not use a T type instance. 

T type instances have the ability to boost beyond 100% CPU when under load.  This would not be controllable and had one other serious and expensive downside.  The T types when bursting incur $0.05 per vCPU-Hour.  So, the cheap T3.Micro for less than a penny an hour just became a nickel.  A >500% increase in cost when consistently at 100% CPU.  So, T types are out.

What we wanted was a CPU work horse for a good price.  To reduce the compute optimized instances more we looked at L3 cache size of the CPU.  The L3  limits the number of CPUs that can be used for mining.  The equation can be simplified to L3 cache / 2 = # of CPUs that can be used.  So, 24MB L3 cache with 24 CPUs would only be able to use 12 CPUs to mine. This limited us to C type instances.

The C5 instance types have good CPU power with high network speed.  Also, since C5 is relatively new the spot pricing is as much as 70% off normal price.  The testing was performed on C5.18xlarge, C5.4xlarge, and C5.2xlarge.

Results

The following is a snapshot of each C5 testing run using the webchain-miner.  Each snapshot shows the CPU info including L2/L3 cache and the number of threads webchain-miner used for mining.  Also, hash rate is shown on the last line as Hash/second.

C5.18xlarge
* VERSIONS:     webchain-miner/2.6.2.0 libuv/1.20.3-dev gcc/6.3.0
* CPU:          Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz (1) x64 AES-NI
* CPU L2/L3:    32.0 MB/24.8 MB
* THREADS:      12, cryptonight-webchain, av=0, donate=5%
* POOL #1:      pool.webchain.network:3333
* COMMANDS:     hashrate, pause, resume
[2018-10-07 23:15:55] READY (CPU) threads 12(12) huge pages 12/12 100% memory 24.0 MB
speed 2.5s/60s/15m 644.1 644.1 n/a H/s max: 644.1 H/
C5.4xlarge
* VERSIONS:     webchain-miner/2.6.2.0 libuv/1.20.3-dev gcc/6.3.0
* CPU:          Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz (1) x64 AES-NI
* CPU L2/L3:    8.0 MB/24.8 MB
* THREADS:      12, cryptonight-webchain, av=1, donate=5%
* POOL #1:      pool.webchain.network:3333
* COMMANDS:     hashrate, pause, resume
[2018-10-08 11:19:48] READY (CPU) threads 12(12) huge pages 12/12 100% memory 24.0 MB
[2018-10-08 11:19:49] use pool pool.webchain.network:3333 212.32.255.143
speed 2.5s/60s/15m 486.4 486.6 n/a H/s max: 486.8 H/s
C5.2xlarge
* VERSIONS:     webchain-miner/2.6.2.0 libuv/1.20.3-dev gcc/6.3.0
* CPU:          Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz (1) x64 AES-NI
* CPU L2/L3:    4.0 MB/24.8 MB
* THREADS:      8, cryptonight-webchain, av=1, donate=5%
* POOL #1:      pool.webchain.network:3333
* COMMANDS:     hashrate, pause, resume
[2018-10-08 11:35:50] READY (CPU) threads 8(8) huge pages 8/8 100% memory 16.0 MB
speed 2.5s/60s/15m 321.8 321.9 n/a H/s max: 322.5 H/s

Table 1 shows CPU and hash rate as it relates to cost.  A higher Hash/Spot is desired as it equates to higher hash with low spend.

AWS C5 instance type CPU to Hash rate
Table 1

The C5.18xlarge had the highest hash rate but also did not use all its processing power.  Th C5.18xlarge has 72 CPUs but was only able to utilize 12 CPU for mining.  The reason is the L3 cache is 24MB which allows for only 12 CPU available for mining.

Similarly the C5.4xlarge did not fully utilize all its CPUs but had the second highest hash.  Out of 16 CPU the C5.4xlarge was able to mine with 12 based on a 24MB L3 cache.

The highest utilized CPU was the lowest hash rate of the C5.2xlarge.  All 8 CPUs were utilized.  C5.2xlarge also is the least costly at $0.13/hour.

CPU utilization to cost is well shown in Table 1.  C5.2xlarge is not only the least cost but also has the most utilized CPU.  As hash to cost is concerned C5.2xlarge is the clear winner with a Hash/Spot of 2476 hash/hour/dollar.

Conclusion

The results were not unexpected as higher CPU utilization at lower cost converged on the least expensive most utilized C5 instance, the C5.2xlarge.   Another finding during testing is the smaller C5.2xlarge have more spot availability.  We were able to get some spot pricing as low as $0.08.  We also found we could spin up 50 C5.2xlarge in one spot request.  For $4 an hour you could spin up a hash rate of about 16 kH/s.  But is it profitable?

Currently, Webchain is trading for around $0.005 but has been as high as $0.007 in the past 2 weeks.  For now, we assume $0.005 is the coin price.  As mentioned above, 16 kH/s is attainable for $4 per hour.  In 24 hours we would spend $96 and make 2,395 WEB worth $11.55.  A net loss of about $85.  Obviously not profitable. 

So, when would WEB become profitable to mine via AWS C5?  Assuming cost does not change for AWS then the value of WEB would need to increase about 10x.  Also, the difficulty should not be remarkably different then when the testing was run.  With all those caveats, when WEB reaches one shiny nickel ($0.05) the break even point is reached.  

Could WEB become profitable to mine via AWS and CPU?  It certainly seems there could be a future convergence of WEB to Cost.


Hopefully you found this useful.  Throw us a few coins to say thanks.


Leave a Reply