Xmrig proxy read error: "connection reset by peer"

image
When xmrig proxy runs for a period of time (maybe several hours), an error will occur.

What OS are you using? Can you see if wownerod is still running, and see if there’s anything in the logs?

My xmrig proxy and wownerod are running on a ubuntu computer, no error message is found on the wownerod, only timeout appears on the xmrig proxy

What does the onset of the errors look like? Does xmrig-proxy begin getting intermittent errors, or does it appear as a storm as in your screenshot immediately?

What is the system load like (load, memory, CPU)?

Right now I still don’t have a handle on what the problem is, but this info might help someone else work it out.

Mining will continue, but there will be 1-10 connection timeouts every few minutes. Even if there are errors, it seems that miners can still mine.

At the beginning, the xmrig agent will print normal output. After a period of time has passed, connection timeouts will appear intermittently, about once every 2-3 minutes.

This is expected. As long as miners remain connected to the proxy, they will continue to mine the last block. You do run the risk of mining a stale block or not being able to submit a block while xmrig-proxy and wownerod are not talking, though.

Do you have a firewall on your machine? What does iptables -v -S (as root) show? (The -v flag will also show connection/byte counters. We want to see whether conntrack or other rules are applied before loopback traffic is ACCEPTed.)

Do any other software on the same machine suffer from the same errors? Is your machine handling lots of connections?

The screen output of executing iptables -v -S

Okay, the firewall is no problem. Let’s see your number of open connections and kernel tunables:

netstat -tn | wc -l
netstat -ltn | wc -l
cat /proc/sys/net/ipv4/ip_local_port_range
cat /proc/sys/net/ipv4/tcp_fin_timeout
cat /proc/sys/net/ipv4/tcp_max_syn_backlog
cat /proc/sys/net/core/netdev_max_backlog
cat /proc/sys/net/core/somaxconn

Thank you, this is screen output.
image

It looks like your server has too many connections open, which could explain the random connection timeouts. Try increasing your local port range, for example:

sysctl -w net.ipv4.ip_local_port_range="16384 64000"

This tunable sets the range of ports that can be used as the local end of outgoing TCP connections. Make sure that the range does not include any server ports you have (see netstat -ltn for a list). The highest possible port number is 65535.

Ideally, the range should contain enough ports for all your outgoing connections (a localhost connection count as both outgoing and incoming).

1 Like

Also try increasing the maximum incoming connections:

sysctl -w net.ipv4.tcp_max_syn_backlog=256
sysctl -w net.core.somaxconn=4096

These increase the length of the queues of incoming connections that haven’t been accepted by listening processes.

Your server looks very busy; it might help to move either xmrig-proxy or wownerod to a more lightly-loaded server. Or you may have a runaway process of some kind.

I revised it as you said, and the problem was solved. To thank you, I can send you some WOW, and you can give me your wallet address.

I’m glad it worked out. To persist the config across reboots, add these lines to /etc/sysctl.conf:

net.ipv4.ip_local_port_range="16384 64000"
net.ipv4.tcp_max_syn_backlog=256
net.core.somaxconn=4096

Expect a DM sometime soon.

I checked and found that 34568 occupies too many socket connections (more than 20,000). Is this normal?

Port 34568? Is your wownerod RPC port public?

Check the output of netstat -tn | grep 34568 and see who’s connected. If most of them are localhost, try stopping xmrig-proxy for a couple of minutes, and see if it reduces the number of connections. It’s possible that xmrig-proxy had been spamming connections when it was getting timeouts.

All connections are local ports, almost all in TIME_WAIT state
image

Yeah, that looks like xmrig-proxy has been spamming connections. TIME_WAIT will expire in about a minute or so.