XMRig Command-Line Options Worth Knowing

XMRig accepts well over a hundred switches. In practice a dozen cover everything a Windows user does from a command prompt.

How switches relate to the config file

Anything you can put in config.json has a command-line equivalent, and a switch overrides the file for that run only. That makes the command line ideal for testing a change and the file right for keeping it. Start the miner from a prompt opened in its own folder, otherwise it will look for the configuration in the wrong directory.

Connecting to a pool

xmrig.exe -o pool.example.com:3333 -u WALLET -p worker1 -k
xmrig.exe -o pool.example.com:443 -u WALLET --tls

-o is the pool, -u the wallet or worker login, -p the password field most pools use as a worker label, -k keepalive. Add --tls only on a port that expects it.

Choosing a configuration file

xmrig.exe -c pool-a.json
xmrig.exe -c C:\Mining\configs\test.json

Useful when you keep one file per pool or per experiment.

CPU and memory

xmrig.exe --threads=6
xmrig.exe --cpu-affinity 0x5555
xmrig.exe --cpu-priority=2
xmrig.exe --randomx-mode=light
xmrig.exe --no-huge-pages

Thread count and affinity are the two you will actually experiment with. The last two are diagnostic: they help you prove that a problem is memory-related, not settings you should keep.

Benchmarking and inspection

xmrig.exe --bench=10M
xmrig.exe --print-time=60
xmrig.exe --log-file=xmrig.log
xmrig.exe --help

--help prints the authoritative list for your exact version, which is more reliable than any article, including this one.

While it is running

The miner responds to single keystrokes in its console window: h for hashrate, s for accepted shares, c for connection details, p to pause and r to resume. Pausing is handy when you want the machine responsive for a few minutes without losing the pool session.

A practical habit

Keep a small batch file next to the executable with the command you actually use. It documents your setup, survives reinstalls, and gives you something to compare against when a change makes things worse.

Settings you want to keep belong in the configuration file.