Monero CPU Mining in Docker

blakwolf

New Member
Apr 17, 2017
10
1
3
47
I'm using minexmr.com, but that's not with a docker image. I started at minergate, but went away from them.
I was using minexmr.com on my desktop, but was wondering if anyone has setup a docker image to use it now.
 

mattipatti

New Member
Jun 21, 2017
4
3
3
43
Hey, I've been working a few nights on an xmr-stak-cpu docker image with env variable configuration. Thought I'd let you guys know, as I couldn't find one anywhere, and the forum posts here and the other docker images linked have helped me quite a bit.

https://hub.docker.com/r/timonmat/xmr-stak-cpu/
GitHub - timonmat/docker-xmr-stak-cpu: XMR-Stak-CPU is a universal Stratum pool miner. This is the CPU-mining version

It's a bit rough around the edges still. The autoconfigure is taken from the xmr-stak.cpu recommendation, and I think they might not be that great in all environments. You can define your own too though. Also the image size is a bit large, as python is required, and the dev tools are still in. I'll see later if it's possible to clean it up a bit.
 

JSchuricht

Active Member
Apr 4, 2011
166
53
28
Thanks mattipatti for the xmr-stak-cpu docker. The auto thread didn't work out for me but a manual setup is netting a respectable 868 on a dual E5 2660 v1 open compute nodes.
 

Klee

Well-Known Member
Jun 2, 2016
1,285
393
83
Thanks mattipatti for the xmr-stak-cpu docker. The auto thread didn't work out for me but a manual setup is netting a respectable 868 on a dual E5 2660 v1 open compute nodes.

Thats the same output as my dual 2660 nodes on bare metal.
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,010
4,995
113
Docker and bare metal should be *very* similar (<1%) in most compute applications. That is one of the reasons I immediately went to docker over VMs.
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,010
4,995
113
Here is an interesting tidbit. Tried the stak-xmr image from @mattipatti on a 112 core machine today. Needed 7800 character docker start command to affine all 112 CPUs. That took awhile just to get setup.

Results:
Code:
| 110 | 43.7 | 43.8 | (na) | 111 | 31.2 | 31.2 | (na) |
-----------------------------------------------------
Totals:   4856.4 4857.2 (na) H/s
Highest:  4857.6 H/s
Hashrate was consistent around 4850 over hours.

The stock Wolf's docker on the same machine gives around 5300 max, 5100 average on the same machine (that you cannot buy just yet.) The hashrate does bounce around a lot more using Wolf's. Same thread count at 112.

I was under the impression that stak-xmr would be a lot faster. It seemed to be under Windows. This makes me want to back-test stak-xmr on some of the larger CPU configurations. Generating CPU affinity configurations one-by-one is painful for 2P/ 4P systems but I am intrigued now.
 

mattipatti

New Member
Jun 21, 2017
4
3
3
43
I run timonmat/xmr-stak-cpu image with a core count auto config method (I updated the image last week. just leave the thread config env variables out, and it'll default to core count now) as they all have enough L3 cache to do that. Generally 2x12/30 or 2x8/20, with a few random smaller vm's in there too. Like Patrick has said, It needs to be easy to just fire up as a service across all the machines you happen to have idling. I can't configure manually, as I don't know which servers it'll deploy to.

I'm kinda hoping the xmr-stak-cpu recommendation would become smarter, and I could switch over to that. I did run wolfs for a while, and got generally slightly lower hashrates. 650 with wolf -> 700 with xmr-stak or 1000 -> 1100.

edit: I also need to run with the USE_SLOW_MEMORY=no_mlck , to make large pages work properly.
 
Last edited:

Klee

Well-Known Member
Jun 2, 2016
1,285
393
83
7800 !!?? Id would have went insane long before that.:eek:
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,010
4,995
113
@mattipatti - Unfortunately, that autoconfiguration completely fails on new processors. I asked the stak devs to add better autoconfiguration but they cannot.

Yes @Klee - that is 100% why I spent so much time profiling different architectures and getting them to work with a single short command.
 

Konflikt

New Member
Jul 5, 2017
8
0
1
40
I was using minexmr.com on my desktop, but was wondering if anyone has setup a docker image to use it now.
hi, do we have alteady an image for minexmr.com? if not, which pool is the best for monero? (reliable, low fee, many users)
thanks
 

Konflikt

New Member
Jul 5, 2017
8
0
1
40
and a test result
with this docker image 1x E5-2680 v4 CPU (14C28T) 35M L3: using bare metal ubuntu gets 650 H/s. (17 threads were started)

not too much, but something.:)
 

Marsh

Moderator
May 12, 2013
2,313
1,119
113
@Konflikt
Good hashrate , looks like v4 is 10% faster than v3 for Monero mining.
what is the power consumption?

My E5-2683 v3 ( older v3 CPU ) produce 600 H/s each . Dual E5-2683 v3 consumes 200w produce 1200 H/s.
I use Ubuntu 16.0.4 , xmr-stak-cpu , minexmr.com pool.
 
  • Like
Reactions: Konflikt

Konflikt

New Member
Jul 5, 2017
8
0
1
40
@Konflikt
Good hashrate , looks like v4 is 10% faster than v3 for Monero mining.
what is the power consumption?

My E5-2683 v3 ( older v3 CPU ) produce 600 H/s each . Dual E5-2683 v3 consumes 200w produce 1200 H/s.
I use Ubuntu 16.0.4 , xmr-stak-cpu , minexmr.com pool.
Hi, the power consumption of the server is 191W
where can i use this "xmr-stak-cpu " miner with debian?
how can I use it with minexmr.com pool?
thanks
 
Last edited:

Marsh

Moderator
May 12, 2013
2,313
1,119
113
xmr-stak-cpu

GitHub - fireice-uk/xmr-stak-cpu: Monero CPU miner
Read the section for Linux

sudo apt-get install libmicrohttpd-dev -y

Instead of letting xmr-stak-cpu auto-config during run time, I edit config.txt manual to tweak it for my system.

I added one lines to /etc/sysctl.conf to enable large page support
vm.nr_hugepages = 40

fun@z10ph13:~/bin$ cat startmining.sh
#!/bin/bash
tmux new-session -d -n xmr-stak-mining
tmux send-keys -t xmr-stak-mining "cd /home/fun/bin/
"
tmux send-keys -t xmr-stak-mining "/home/fun/bin/startxmrstakcpu.sh
"

add these lines to /etc/security/limits.conf
* soft memlock 626688
* hard memlock 626688

reboot system to make system tuning effective.

in my $HOME/bin directory
I created a script file call startmining.sh

#!/bin/sh
pidof xmr-stak-cpu >/dev/null
if [ $? -ne 0 ] ; then
echo "Restarting xmr-stak-cpu: $(date)" >> /home/fun/bin/logs/xmr-stak-cpu.txt
/home/fun/bin/xmr-stak-cpu /home/fun/bin/config.txt
fi

exit

To have system start mining , I added this line in /etc/rc.local
/home/fun/bin/startmining.sh


To mine with minexmr.com
make the change in config.txt
"pool_address" : "pool.minexmr.com:3333"
 
  • Like
Reactions: Klee and Konflikt

Marsh

Moderator
May 12, 2013
2,313
1,119
113
There is small gotcha for log file
in config.txt , I added
"output_file" : "logs/xmr.log",

You will need to create $HOME/bin/logs directory , otherwise xmr-stak-cpu would error out.
 

Konflikt

New Member
Jul 5, 2017
8
0
1
40
Thank You!
that was useful:) finally I could do it.
what I noticed, that the "Expired Shares" value is around 4% for me (checked at the pool site), but the normal value should be around 1% ( mineXMR.com - Monero mining pool )
do you have any idea what can be the problem?
I have high speed internet, w low latency.
 

Marsh

Moderator
May 12, 2013
2,313
1,119
113
Let it run for a while like 12-24 hours , check again to see if expired shares goes up.

What is your pool connection port #?

If you have fast CPU, lock the Difficulty to Port 3333 ( Description: Modern High End ), so it won't auto-adjust.

If you are not using Port: 3333 , then the pool software would need to go through auto-adjustment of Difficulty setting.
In turn may caused more expired shares.

The miner program dev-fee is paid by mining 1% time to developer's mining pool. Every time it switch to mine at the dev mining pool, then switch back to minexmr.com pool. It would go through auto-adjustment of Difficulty again.
 
  • Like
Reactions: Konflikt

Konflikt

New Member
Jul 5, 2017
8
0
1
40
Let it run for a while like 12-24 hours , check again to see if expired shares goes up.

What is your pool connection port #?

If you have fast CPU, lock the Difficulty to Port 3333 ( Description: Modern High End ), so it won't auto-adjust.

If you are not using Port: 3333 , then the pool software would need to go through auto-adjustment of Difficulty setting.
In turn may caused more expired shares.

The miner program dev-fee is paid by mining 1% time to developer's mining pool. Every time it switch to mine at the dev mining pool, then switch back to minexmr.com pool. It would go through auto-adjustment of Difficulty again.
Thanks. now after 12 hours the expired shares around 2%.
There are several different servers, even w/o AES (e.g. Nehalem, Westmere CPUs) and there are Interlagos AMDs 6282/6220, which are not too bad. (has a lot threads).
Port is default 3333. do I need to change it?
 

Marsh

Moderator
May 12, 2013
2,313
1,119
113
There are several different servers, even w/o AES (e.g. Nehalem, Westmere CPUs) and there are Interlagos AMDs 6282/6220, which are not too bad. (has a lot threads).
You may want to use port 7777 for the older CPU.
 
  • Like
Reactions: Konflikt