The Ethereum miner ethminer
sometimes produces variable hashrates like:
miner 02:16:07.510|ethminer Mining on PoWhash #ad8608a0… : 20971520 H/s = 4194304 hashes / 0.2 s
miner 02:16:07.711|ethminer Mining on PoWhash #ad8608a0… : 83468736 H/s = 16777216 hashes / 0.201 s
miner 02:16:07.913|ethminer Mining on PoWhash #ad8608a0… : 41734368 H/s = 8388608 hashes / 0.201 s
miner 02:16:08.114|ethminer Mining on PoWhash #ad8608a0… : 83468736 H/s = 16777216 hashes / 0.201 s
miner 02:16:08.315|ethminer Mining on PoWhash #ad8608a0… : 41734368 H/s = 8388608 hashes / 0.201 s
miner 02:16:08.517|ethminer Mining on PoWhash #ad8608a0… : 83468736 H/s = 16777216 hashes / 0.201 s
miner 02:16:08.718|ethminer Mining on PoWhash #ad8608a0… : 41734368 H/s = 8388608 hashes / 0.201 s
miner 02:16:08.920|ethminer Mining on PoWhash #ad8608a0… : 83468736 H/s = 16777216 hashes / 0.201 s
How do you calculate the average hashrate in this case?
This situation occurs commonly when your GPUs are overclocked, or the ethminer
parameters --cl-local-work
and --cl-global-work
are changed from the default settings.
Update
Reddit user athropal has stated in reddit.com/r/EtherMining:
The hashrate is not variable, only the reporting math is inaccurate because of the short farm-recheck time. If you look at qtminer, which uses a more effective method of getting data, it has longer periods of time to calculate the hashrate of, 2 seconds vs 0.2. The reported hashrate there is much more stable.
Best Answer
Here is a Perl script that will calculate your average hashrate and display the important lines in your
ethminer
log files:This script works on Linux and Mac OS X as the Perl interpreter is available on these platforms by default. For Windows, you may have to try Perl from perl.org.
Note that this hashrate is calculated when
ethminer
is calculating it's hashes, and does not include the time thatethminer
is getting a new work package fromgeth
(or the pool) or when it is submitting the results togeth
/pool.Copy the following lines into
$HOME/bin/calcHashrate
, and set the executable bit for this file by running the commandchmod 700 $HOME/bin/calcHashrate
.calcHashrate
Sample Usage
Run the script with the default settings, calculating the average hashrate over the last 1,000 lines, show up to 4
accept
lines and show up to 4FAILURE
lines. The line at the bottom shows the last hashrate time and the average hashrate in megahashes per second.Run the script to just display the hashrate over the last 1,000 hashrate lines.