Blog

A Cost-effective Way to Handle Tomorrow's Performance-hungry Applications

Confessions of an old-school crypto miner before Ansible was cool

Written by Marius Rimkus
on July 02, 2019

Everybody remembers when Bitcoin sky-rocketed to $19,783.06 on December 17, 2017. Ethereum, Ripple, Zcash, Monero and most of the other crypto currencies were at their top likewise. It was a very special time before Christmas, when even those who knew barely anything about investing, nor had any money to invest, were ready to change up their last pennies into these magical tokens. You could even hear kids speaking about crypto currencies at schools. All these guys and gals hoped to grow their fortunes out of this flurry and plunged into mining crypto currencies. But did these people know anything about blockchain technology at all? Meanwhile, Cherry Servers have leased all their GPU servers. Plenty of them for miners.

I remember being one such miner myself. As I’m a hands-on learner, not yet a DevOps guy, I had started ordering GPU accelerated servers and built my own mining farm with zero experience. Let me tell you how it went out.

 

Problem

Imagine yourself building a rather ambitious server farm with 50 GPU servers to mine Zcash. You would want each of them to have GPU accelerators, say, 2x Nvidia GTX1080 cards. First, you need to choose a cloud provider. As I work at Cherry Servers, there was an obvious choice for me 😊 Then you need to order your servers. This was a bit more tricky for me, since I chose to order dedicated servers manually and paid for them on a monthly basis. Monthly contract is a casual thing with most providers, but this means you are freezing your investment for a month at least, not knowing if your efforts will bear any fruit. Finally, when servers are deployed, you need to install your mining software. Doing this manually, as I did, will take you a few days. Still, this is just a start where all the joy begins.

OK, you now have a profitable mining farm of 50 servers in operation. Let’s say you start making some nice profit, as Zcash price is growing steadily. Two weeks pass by and out of the blue Zcash value drops dramatically and your mining farm becomes inefficient. As you have already paid for a month upfront, you have to keep the servers running, even though they do not generate profit anymore. It quickly becomes a headache, as you are locked-in for a few more weeks of unprofitable mining. There’s no way out, so you keep your mining farm active hoping for the best. Zcash value might return to its highs, but it might drop even further as well. So is there any solution to such situation?



Solution

It seems like yesterday, yet 2 years ago there were not so many cloud providers. There were also just a few dedicated server providers offering servers with GPU accelerators for high performance computing projects. And look at the market now. Cherry Servers has introduced Bare Metal Cloud with hourly billing and API integrations, where you can now get servers with GPU accelerators programmatically via API, billed on a per-hour basis. Meanwhile, DevOps has become a prevalent approach to distributed system engineering with numerous new open source tools to automate everything from A to Z when creating a cloud-native stack. Speaking about my previous mining scenario, I now see 5 steps that could have helped me build a crypto-mining cluster easier and quicker by automating certain processes. Let me illustrate few of these steps by using Cherry Servers Ansible module or client portal.

  • Order 50 servers.

Example:

# server_deploy.yml

- name: Cherry Servers API module
connection: local
hosts: localhost
tasks:
- name: Deploy CherryServers Server
cherryservers_server:
hostname:
- server%02d.example.com
plan_id: '161'
project_id: '79813'
image: 'Ubuntu 16.04 64bit'
region: 'EU-East-1'
state: present
count: 50
count_offset: 1
ssh_label:
- john
- marius

  • Install required software.
  • When you see mining is inefficient, you can cancel some, or all your servers in seconds.

Example:

# server_terminate.yml

- name: Cherry Servers API module
connection: local
hosts: localhost
tasks:
- name: Remove CherryServers server
cherryservers_server:
project_id: '79813'
hostname:
- 'server03.example.com'
- 'server04.example.com'
- 'server06.example.com'
state: absent

  • While you are on hourly billing, you do not need to pay upfront, so you can cancel servers anytime and billing will stop immediately.

terminate cherryservers cloud server

  • You can also make a script that monitors Zcash (or anything else) exchange rate to let your Ansible module know if to keep the servers or cancel them, because it makes no profit anymore.

Zec/BTC graph

 

Conclusion


From server provisioning to termination, there are plenty of possibilities to automate your infrastructure. Combining elasticity of a cloud with DevOps best practices crypto miners can now lower the risk and increase liquidity of their investments. Not only it can increase your profits, but also saves time and makes your life as a crypto miner much easier. Welcome to the cloud 2.0

Subscribe to our blog

A Cost-effective Way to Handle Tomorrow's Performance-hungry Applications