Welcome To The Foreman Knowledge Base

How To: Tune Windows for Pickaxe - Adjusting TCP Settings for Heavy Load on Windows

Pickaxes uses TCP/IP ports and non-blocking NIO SocketChannels to connect to miners on the network. These connections remain open in the TIME_WAIT state until the operating system times them out. For pickaxes with 1000+ miners, the available ports on the Windows machine can be exhausted, especially during curtailments.

Performance Comparison

When connection rates exceed system capacity, you may experience failures as the supply of TCP/IP ports is exhausted.

Windows

  • Default timeout: 120-240 seconds (varies by version)
  • Maximum ports: ~16,000
  • Maximum connection rate: 67-134 connections per second
  • Performance degradation occurs with as few as 1,000 miners

Linux (Ubuntu 24.04)

  • Default timeout: 60 seconds
  • Maximum ports: ~28,000
  • Maximum connection rate: 466 connections per second
  • Approximately triple the throughput of Windows

Symptoms

  • Drops in throughput
  • Errors indicating failed network connections
  • Miners reporting "Miner Not Updating" error
  • Failures to sleep/wake miners due to network timeouts

Diagnosis

Use the netstat utility to observe the system while under load and confirm port exhaustion is occurring.

Solution

To avoid port exhaustion and support high connection rates, reduce the TIME_WAIT value and increase the port range.

Set TcpTimedWaitDelay (TIME_WAIT)

  1. Run regedit to access the registry
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters
  3. Create a new REG_DWORD value named TcpTimedWaitDelay
  4. Set the value to 60
  5. Restart the system

Set MaxUserPort (Ephemeral Port Range)

  1. Run regedit to access the registry
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters
  3. Create a new REG_DWORD value named MaxUserPort
  4. Set the value to 32768
  5. Restart the system

Important Note

While these registry changes improve the theoretical connection limit and performance on Windows, Linux is still recommended as it handles high volumes of TCP/IP traffic better than Windows.

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.