Optimizing Monero Mining with a Slow Laptop

I blogged recently about how to set up a Monero crypto-currency mining operation earning a whopping 2 cents per day.  I’ve figured how to double that to 4 cents per day!

Mining consists of taking the previous block’s hash and combining the hashes of whatever transactions are being added on and then finding the magic number (“nonce”) to also add in so that the resulting hash turns out correct – usually a specified number of zeros at the beginning of the hash.  The whole nonce and finding a magic hash is really “do nothing” work that can be used to throttle the operation of the network.  If hashes area solved more often than every 2 minutes (for Monero), the whole network cooperatively agrees to find more leading zeros on the next one to slow down the process.

As an aside, realize that finding the magic nonce number to make zeroes in a hash is the same as guessing passwords for your computer.  Most computers don’t store passwords, but they store the hash of the passwords, so if you match the hash, you’ve found the password.  Here’s a SHA-256 hash of my password – 5E884898DA28047151D0E56F8DC6292773603D0D6AABBDD62A11EF721D1542D8. Feel free to guess at different passwords and see if you can match it.   Here’s a program for calculating hashes, if you don’t have one, or you can use this SHA-256 calculator on line.  Or, you could download millions of pre-calculated hashes for passwords people have already used.  If you want, you could run the rcrack to do passwords instead of xmrig, which does cryptocurrency block hashes. No big surprise that xmrig is often snagged by virus scanners as a trojan.

Assuming you’re in a mining pool like moneroocean.stream, you’ll get assigned a nonce to try and then your computer reports back the results.  With my 1.73 GHZ 64-bit Intel Core i7 Q740 processor (1 MB L2 cache, 6 MB L3 cache) laptop, I was able to sustain an average of only 25 hashes/sec even when I set the configuration file limit to 100% CPU in the xmrig configuration file. Here’s the startup window as xmrig starts:

Doing 25 hashes/sec averages out to about 2 cents per day at current monero prices and pool payout.  Looking at the Windows 10 Resource Monitor, I noticed I was running only about 40% of the CPU for some reason – maybe cache limited?

Running a second instance of the program boosted the hash rate into the high 30s.  CPU maxed at a stead 80% even though the limit was set to 100%.  So.. I ran a third instance of the program.  CPU maxed at 100%, with the three processes each taking about 33%.  My hash rate as measured on the moneroocean.com website dashboard has stabilized at 55 hashes/sec.  That’s a 100% increase from what I originally had by simply running 3 instances of the miner on the laptop rather than one.

Notice the three xmrig processes, each using about 33% of the CPU.  As I brought each on-line, CPU went from 40% to 80% to 100%.  Running a 4th instance knocked the CPU % on each down to 25%, so I reached the point of no value return.  I went back to running 3 instances.

I started on moneroocean port 10001 (25-50 hashes/sec) in all 3 windows, which initially issues hashes with difficulty of about 1000.  My triple-instance laptop must have been too slow because over the course of about 20 job submissions to me, the moneroocean server has backed all three instanced down to difficulties of 630, 480, and 510.  My hash rate has dropped from 55 to 50.  But at least I kept my CPU 100% occupied.

When I was running on port 80 (1-5 hashes/sec), the difficulty started at 100 and had automatically crawled up to 800 when running one instance.  I think I’ll stay on port 10001 and let it adjust down rather than 80 and let it adjust up. Probably doesn’t matter.

Keeping 3 instances of the xmrig program running seems to keep my CPU 100% tasked and does the most calculations.  Because the xmrig process is started with a lower than normal priority, when I type on the keyboard or do something else, the xmrig processes yield.

About Brian

Engineer. Aviator. Educator. Scientist.
This entry was posted in General. Bookmark the permalink.

Leave a Reply