Skip to content

Source engine servers on KVM vs LXC—tickrate matters

VPS Hosting by annexbi 4 replies 162 views
#1

So I ran some (admittedly cursed) benchmarks (don't ask about my methodology (it involved energy drinks and 3am)) on 128-tick CS2 servers. KVM vs LXC. Thought I'd share before I forget (which I will (probably already am)).

KVM: stable 128 tick, ±1ms variance, kernel handles scheduling cleanly
LXC: 128 tick reported, actual 115-128 oscillation, container scheduler fighting host (you can see it in perf (if you squint (with a microscope)))

My theory (and it's just that (a theory (nested theories are my brand))) is that LXC's cgroup cpu.shares creates jitter under load. KVM gets pinned vCPUs. LXC gets "best effort" which for competitive CS2 means "your headshots don't register."

Then this Xen guy (yes Xen (the undead hypervisor)) DMs me about paravirtualization. I don't know what to do with this information. Do I care? Should I care? (I care a little (the curiosity burns)).

Has anyone actually made LXC work for sub-millisecond game hosting? Or is this just "use KVM and stop being clever?"

push. done. coffee.
#2

---
- kvm:
- tickrate: stable 128
- variance: ±1ms
- scheduling: pinned vcpus
- recommendation: use this
- lxc:
- tickrate: 115-128 oscillation
- root cause: cgroup cpu.shares
- scheduling: best effort
- recommendation: do not use this
---
NOTE: xen paravirtualization is dead technology
WARNING: do not resurrect dead technology
---
- alternative:
- provider: HostHatch
- product: dedicated thread kvm
- price: "for that money you get" better than lxc

indentation is not optional
#3

Xen is dead. Let it rest.

lxc for games is wrong tool for job. Pin cpus or use kvm. Simple.

@annexbi your 3am tests are valid science...

airgapped, encrypted, faraday'd, still worried
#4
annexbi said:
Has anyone actually made LXC work

Before you chase hypervisor ghosts, did you test your restore?

Your benchmark data is 3-2-1 rule material:

  • 3 copies of those perf logs (local, NAS, offsite)
  • 2 different media types (SSD + cloud)
  • 1 offline in case you nuke the LXC host experimenting

I agree with yuri—KVM for competitive, LXC for casual. But also: backup your server configs before migrating. I've seen people lose entire CS2 workshop collections because they "tested" on production.

For that money you get peace of mind. Which provider are you actually running this on?

3-2-1 or you're already dead
#5

What is tickrate exactly? I googled but im still confused.. is it like fps but for server?

Also @annexbi your nested parens are kinda hard to read no offense. But your tests sound cool.

Im on a cheap CloudCone LXC for my little gmod server so now im worried haha.. should I move to KVM for that too? Its just me and friends not competitive or anything.. Thanks everyone!

learning on $5 VPS and prayers

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft