No KYC VPS
GuidesNov 14, 20267 min readBy the No KYC VPS team

VPS for Trading Bots and Low Latency: What Actually Matters

Choosing a VPS for a trading bot: distance to the exchange, steady CPU, jitter, uptime and security. What to measure and how to test before you commit.

A trading bot does not need a huge server. It needs a steady one that sits close to the exchange and never goes down at the wrong moment. Here is what to look at.

1. Distance to the exchange

Network latency grows with distance, so pick a location near the exchange API you use. Many large exchanges serve their APIs from Europe or East Asia. Test from each candidate region instead of guessing:

ping -c 20 api.exchange.example
mtr -rwc 50 api.exchange.example

Look at the average and the worst case. Our guide to choosing a VPS location explains the trade-offs.

2. Jitter and packet loss

A steady 40 ms beats a link that swings between 10 ms and 200 ms. Check the StDev and Loss% columns in mtr. Run the test at different times of day.

3. A steady CPU

Bots are often single-threaded. Prefer higher clock speed over many cores, and check CPU steal time under load:

top    # watch the "st" value
vmstat 1 10

A steal value that stays above a few percent means neighbours are taking your cycles.

4. Uptime and restarts

Run the bot as a systemd service so it restarts on failure and after a reboot:

[Service]
ExecStart=/usr/bin/python3 /opt/bot/main.py
Restart=always
RestartSec=5

5. Linux or Windows?

Use a Linux VPS for scripts and libraries. If your platform is Windows-only, such as MetaTrader, use a Forex VPS with Windows RDP.

Measure latency before you commit

Do not guess which location is fastest. Test from the server to the exchange's API address. Start with a ping and a route trace:

ping -c 20 api.example-exchange.com
mtr -rwc 50 api.example-exchange.com

Run the test at different times of day and compare the average and the worst result. A steady 40 ms is often better for a bot than 15 ms with spikes. Test the real API too, with curl -w "%{time_total}\n" -o /dev/null -s URL.

Keep the bot running reliably

  • Restart on failure. Run the bot as a systemd service with Restart=always so a crash does not leave it stopped.
  • Keep the clock exact. Many exchanges reject requests with a wrong timestamp. Use chrony or systemd-timesyncd.
  • Limit your API keys. Give the key trading permission only, never withdrawal, and restrict it to your server's IP address if the exchange supports it.

6. Protect the keys

  • Use API keys with trade permission only, never withdrawal.
  • Restrict each key to the server's IP address on the exchange.
  • Harden the server first: secure a new VPS in 15 minutes.

See also our page on VPS for trading bots.

Frequently asked questions

Where should I put a VPS for a trading bot?

Close to the exchange's API servers. Test latency with ping and mtr from each candidate region.

How much CPU does a trading bot need?

Usually little. A steady clock speed and low steal time matter more than many cores.

Should I use Windows or Linux?

Linux for scripts and libraries. Windows RDP only if your platform, such as MetaTrader, needs it.

How do I keep API keys safe?

Allow trading only, never withdrawal, and restrict each key to the server's IP address.

Does a faster CPU make a trading bot faster?

Rarely. Most bots wait for the network, so distance to the exchange matters more than CPU. A faster CPU helps only if your own calculations are heavy.

Should I run the bot in Docker?

You can. Docker makes updates and rollbacks easier. Set a restart policy so the container comes back after a reboot.