Mining Ethereum on AWS until now wasn’t profitable. This new AWS instance is the game changer that no only breaks even but can finally make you money!
Ever since I wrote my first article about Ethereum and Bitcoin mining on AWS more than a year ago I was bombarded over and over again with the same sort of questions :
- Is it profitable now that the ETH price has increased?
- … that this new AWS instance type was released?
- … that this new coin is the hype of the day?
So far the answer was always a NO. The profitability has gradually improved from some $20 mined in ETH for every $100 spent on AWS services a year ago, to $60 or $65 in ETH for the same $100 AWS spent a month ago. You would still be losing money though.
Until now. Let me introduce you two new GPU-enabled EC2 instances, one of which finally changes the game. It took me some time to benchmark them because they are not the typical some-kind-of NVIDIA GPU in some-kind-of Intel CPU platform that we have seen so far in the form of p3.2xlarge, g4dn.xlarge, or as the newer g5.xlarge instances. Nope, these two that we are going to benchmark today are completely different and need a different setup. That’s why it took me a bit longer to get report on them.
TL;DR — for the impatient
Here is the most recent hashrate chart, updated with the g4ad.xlarge and g5g.xlarge instances discussed in this post.
Right now the most cost efficient EC2 instance for ETH mining is g4ad.xlarge at a spot price in one of the US regions. You can actually make money with it — the cost of running g4ad.xlarge can be slightly lower than the value of the mined ETH. That means profit!
Read below for details or start mining by launching the Ethminer CloudFormation template in us-east-1, us-east-2, or us-west-2. For any other region go to my AWS Ethereum Miner GitHub repo and download the CloudFormation templates from there.
To choose your AWS region consult this table:
g4ad.xlarge — yay, finally getting rich!!
Again, this is a completely different platform from the ones that we have discussed before. While the CPU is an unexciting AMD Epyc that have been seen in the T3a, M5a or M6a before, the GPU here is AMD Radeon Pro V520. Long story short it clocks around 48 MH/s at the spot price as low as $0.1136. That’s faster and cheaper than the above g5g.xlarge! In fact it’s so fast and cheap that it is profitable.
To make sure that I’m not dreaming I ran 5 of these instances for just over 2 days and mined into a new Ethereum wallet to have a clean picture of the results.
- AWS cost: $30.95
- ETH mined: 0.00820 worth $33.36 at that time
That means ca $108 in ETH for $100 spent on AWS costs!
That. Is. Brilliant! ETH mining on AWS finally makes some sense.
Bear in mind that the spot prices fluctuate, that you may not be able to get g4ad instances due to a high demand, and that the ETH price and the Ethereum network difficulty are volatile like everything in crypto. The profit margin is thin but right now it works.
On Dec 24 the instances ran for the whole day. Therefore we can calculate the effective spot price: $13.76 per day / 5 instances / 24 hours = $0.1147/hr per instance. Slightly above the rock bottom $0.1136 but still profitable.
How do I start mining?
I have covered that in details in my previous articles. I suggest you check them out…
To recap you will need:
- Ethereum web wallet — I recommend MetaMask as it allows you to easily change the payout settings at the Ethermine mining pool. If you don’t know what a mining pool is head over to my first article linked above, there I explain it.
- Your Ethereum wallet address — that’s where the mined ETH will be sent from the pool. Once they’re in your wallet they are truly yours. Copy the wallet address from your MetaMask plugin once it’s configured.
- AWS account with high enough service limits to start “G spot instances”, that is g4ad, g5g, g5 or g4dn and eventually also “P spot instances” for running p3 or p3dn instances.
Request the service limit increase through Service Quotas -> AWS Services -> Amazon Elastic Compute Cloud (Amazon EC2) in each region where you’re planning to run the miners.
If your account is new request a small increase first. For example to 4 or 8 vCPUs in one region then use it for a while and then request some more. You’re not likely to get an approval for a high increase without a history of using them!
Note that both g4ad.xlarge and g5g.xlarge have 4 vCPUs, therefore a limit of 8 vCPUs will let you start 2 mining instances.
Deploy the ETH miner CloudFormation stack
With these pre-requisites out of the way go ahead and start mining. Choose a region that offers the required instance types and deploy the ready to go CloudFormation template from my AWS Ethereum Miner GitHub project. The template is “intelligent” enough to figure out what instance types are available in each region, what are their spot prices and which one is the most cost effective to run.
Login to your AWS account and launch the miner in one of the regions where g4ad.xlarge is offered:
- us-east-1 (N. Virginia)
- us-east-2 (Ohio)
- us-west-2 (Oregon)
- eu-west-1 (Ireland)
- eu-west-2 (London)
- eu-central-1 (Frankfurt)
- ca-central-1 (Canada)
- ap-northeast-1 (Tokyo)
You can set the required hashrate, choose the desired instance types and of course set your Ethereum wallet address.
Once the stack is created navigate to its Outputs to find the link to your Ethermine dashboard. Be patient — the miner stats may take around 15 to 20 minutes to appear and another hour or more to ramp up. You should mine for at least 6 to 12 hours to receive some meaningful results.
Thanks for the article and I am now trying, I launched the stack and it returned 3 templates as follows,
lt-0e605af5cbd03d871 LaunchTemplateCudaARM64_KWGfIZrcqpM2 1
lt-0952e56f801405bd4 LaunchTemplateRadeonX8664_KhDUtaCGNL44 1
lt-0dee62b57ab4caaff LaunchTemplateCudaX8664_yJZ5wvjKG4jX 1
Which 1 should I go for, please.
These launch templates will be used automatically depending on what type of instance is launched. If you don’t see any instance running make sure that you’ve got high enough service limits for G and P type instances. To check and increase them go to EC2 -> Limits -> look for “G spot”, “P spot”, and the corresponding on-demand. Note that service limits are per-region, you’ll have to increase them in each region where you plan to do your mining.
How i use the script to increase quotas?
I’m afraid that at the moment you won’t have much luck with raising service limits. There is a lot of demand for GPU instances and AWS is quite reluctant to increase the limits.
Anyway having said that the best way to start is to check your limits with
./increase-quotas.sh g4ad 0which will list the current settings. Then replace the 0 with the desired value, e.g. to raise it to 64 vCPUs in each region do:
./increase-quotas.sh g4ad 64
Is Amazon OK with allowing you to mine using their services? I want to increase my service quota but I have no other reason to offer them other than mining.
They don’t mind mining but they won’t approve GPU limits for it. Also don’t use any free credits for mining, that’s against the T&C. Good luck with that.
Hey Michael ludvig thanks for this great content !
i have a question , for now this is not profitable , however if it becomes back again profitable so didnt wanted to try it for now .
but wanted to know if AWS wont detect this and shutdown our instances or account because of doing this ? is there any risk of this kind involved ? or is this stack fully undetectable by AWS systems ? the only thing is to know how to ask for limits without saying we are going to mine and thats all ?
AWS doesn’t seem to care about crypto mining as long as you’re not using their free promo credits for it. Crypto mining is explicitly forbidden in the credits T&Cs.
And how to get service limits increased? Well that’s a tough one. Be creative in the request I guess 😉
Hello Michael I Install ubuntu 18 amd driver but it does not start mine ethminre in g4ad instance
No OpenCL platforms found
CUDA Error : No CUDA driver found
Error: No usable mining devices found
Please can you help me ubuntu 18 or ubuntu 20 ?
Hi, why don’t you simply use the provided AMIs? There has been quite a lot of work put into the templates to make sure that they work for everyone out of the box.
Since you’re also trying to run ethminer I suggest you stick to the provided templates and you will be mining in no time. 😉
Is it still possible?
It certainly is still possible to mine ETH (until September 15) and ETC (now and after Sep 15). The profitability varies between the two coins.
Hey Michael ! Josh Here asking again !
Eth Mining is soon stopping , in 15 days im i right ?
what if you create a new cloud formation stack for another coin that will keep mining ? lets say btc , ethereum classic …etc ? this would be amazing if you can do
I have updated the github repository with ETC mining support. You can start ETC mining now or wait for ETH to end and then switch over.
Let me know how it goes.
Hey Michael ! wanted to know what do you think About cpu Mining ? and what about Flux and other more profitable coins thatn ETC , whats your opinion about them ?
Hi Josh, CPU mining is terribly unprofitable. I would only run it in parallel with a GPU miner to make use of the unused CPU power, however it’s one more thing that you have to take care of. Regarding other coins – sure some are more profitable than others but adapting the template will require some work. For start I haven’t found a miner software that supports both Nvidia and AMD GPUs and both x86-64 and ARM64 archs. So there will have to be some special cases based on the coin and software used. It’s on my TODO list. If you have any special requirements and need it soon let me know and we can discuss.
Hi Michael, Is there a way to overclock g4ad instance gpu v520 I saw in youtube someone getting 70 mhs
Hi Josh, I’m afraid that the AWS GPUs can’t be overclocked. It makes sense, AWS wouldn’t want the users to push the GPUs beyond the manufacturers specs and potentially damage them from overheating or PSU issues.