A Garry's Mod server on a VPS: what handles the load on DarkRP and Sandbox
Garry's Mod runs on the old Source engine, and its dedicated server is the same srcds used by Valve's classic games. The core itself is very light: an empty Sandbox map for a dozen players starts even on the most modest plan. The load comes not from the engine but from Lua addons. A DarkRP roleplay server with a hundred scripts, its own economy and inventory can bring down a machine that easily handled Sandbox for 40 people. So choose a VPS for Garry's Mod by game mode and addon set, not by the number of slots.
CPU matters more than memory
The srcds game logic and all Lua code run in a single thread. Every tick the server has to process prop physics, the hooks of every addon and network messages; if it can't keep up, players see stutters and "rubber-band" movement. By default the server runs at 66 ticks per second, and on a busy DarkRP server it's the core clock speed that decides whether it can hold that rate. Hence the default filter in the table: 2 cores from 3 GHz, one core for the game and the second for the system, backups and the database. The VPS with high CPU clock speeds page makes it easy to compare processors.
- Sandbox, TTT, Prop Hunt for 16–32 players: 2 cores and 2–4 GB of memory.
- DarkRP for 40–60 players: fast cores, 4 GB, a separate MySQL for player data.
- A large RP project with 80+ slots: 6–8 GB and CPU headroom; the game server and the website with the donation shop are often split across different machines.
32 or 64 bit: the memory ceiling
The main server branch has historically been 32-bit, and the process can't use more than about 4 GB, however much memory the VPS has. Heavy addon sets hit this ceiling and crash with Lua out-of-memory errors. The fix is to install the x86-64 branch (in SteamCMD: app_update 4020 -beta x86-64): it removes the limit, but some older binary modules aren't built for it, so you'll have to replace them or find 64-bit versions. On Linux the 32-bit branch also needs 32-bit libraries, and without them the server won't start; this is a common reason for "nothing launches" on a fresh Ubuntu.
Content, Workshop and player downloads
Many popular DarkRP and TTT maps use Counter-Strike: Source textures. To avoid purple-and-black checkerboards and red "ERROR" models on the server, install the CS:S dedicated server as a separate SteamCMD app and mount it through mount.cfg. If you already run a Source 2 server, compare the requirements with the VPS for CS2 page: the priorities there are different.
The easiest way to distribute addons is a Steam Workshop collection: the +host_workshop_collection parameter downloads it to the server, and clients get the files from Workshop when they connect. For content outside Workshop you set up FastDL, an ordinary HTTP server with compressed files whose address goes in sv_downloadurl. You can run it on the same VPS with nginx, but with many players online file downloads eat up bandwidth, so check the port speed and the traffic limit.
Ports, token and security
The game and server list queries use 27015/UDP; RCON uses the same number over TCP, and it's worth closing it with a firewall to everyone except your own IPs. Be sure to register a Steam game server login token (GSLT) and set it in sv_setsteamaccount: without it the server gets a ranking penalty and is less visible in the public list.
A particular risk for RP projects is addons from unverified sources. Addons downloaded from forums and unofficial packs often turn out to contain backdoors that grant an outsider superadmin rights or execute arbitrary Lua code. Install addons from Workshop or buy them from their authors, give ULX or SAM permissions only to trusted people, and back up the database before every update. If you run several servers, it's convenient to manage them through a panel; a VPS for Pterodactyl will do the job.
Typical mistakes
The first is taking many slow cores instead of a couple of fast ones: srcds uses only one anyway. The second is keeping DarkRP data in SQLite on a server with a large online count: with hundreds of players and writes every few seconds, it starts slowing down the tick. The third is never restarting the server: Lua addons accumulate memory over time, and a scheduled nightly restart removes most "unexplained" lag. The built-in Lua profilers help find the culprit: they show which hook or timer eats the tick time. And finally, choosing a location by price: players in Russia will notice the difference between a ping of about 10 ms from Moscow and 60–80 ms from distant Europe, especially in shooter modes. Wherever your community is, pick a data centre close to most of your players.