Related posts
- Centrifugo at forum scale, loopback only
My setup script now installs Centrifugo, the realtime server my XenForo add-on uses for live posts, typing and presence. It is a verified release binary on loopback, in a unit that scores 1.1 in systemd-analyze, behind one exact nginx location with small tunnel buffers. A load test to 10,000 sockets set the defaults, and a run to 50,000 showed why the old default was wrong.
- Compiling Valkey, and the BOLT flag that gave my binaries an executable stack
Valkey from source was 35 % slower until I stopped passing CFLAGS on make's command line. Then its unit refused the BOLTed binary, which exposed an executable stack in my compiled PHP and Angie too. Plus nginx vs Angie, compiled the same way.
- OpenLiteSpeed and LSCache against Angie for a large XenForo forum
A four-way shootout on a seeded XenForo forum: Angie with PHP-FPM and its FastCGI cache, the same with a clang-built PHP, and OpenLiteSpeed with LSAPI and the official LiteSpeed Cache add-on. Angie serves cached guests 16-23 % faster, members are a tie, and the add-on's documented setup shows logged-in members the guest page.
When I added Centrifugo to my setup script, it was built with two engines. The default keeps channels, presence and history in Centrifugo’s own memory. The other,
engine=valkey, pointed Centrifugo’s Redis engine at the Valkey the script already runs for XenForo. The instruction for it was simple: pair Valkey with Centrifugo if it improves performance. This post covers why the first build never started, the A/B that followed, and whyengine=valkeyis now removed.The unix socket that wasn’t#
The script runs Valkey on a unix socket only, so the first build of
engine=valkeygave Centrifugo aunix://address for it. Centrifugo 6.10.4 accepts that kind of address, but the service never started; it failed with adial tcp ... missing porterror.Centrifugo 6.10.4 accepts the
unix://address but then dials every Redis address over TCP, whatever the address says. So in this version there is no way to reach Redis or Valkey over a unix socket. Every address goes out over TCP.Nothing broke on the server. The script keeps a new Centrifugo configuration only if the service starts and answers
/health, and this one didn’t, so the run rolled back to the memory-engine configuration, which kept serving.The method#
To still answer the question, I ran the Redis engine against a throwaway Valkey 9.2.1 on
127.0.0.1:16379, with no persistence, on the test host only, and removed it afterwards. Everything else matched the load test that set the defaults:The numbers#
At 4,000 sockets the two engines are the same within noise.
At 10,000 the Valkey engine has the lower median, 7 ms against 35-37 ms. Everything else went the other way. Its p99 was worse in every round, by 2-3x in the first two and 6.5x in the third. Centrifugo used up to twice the CPU, plus a little for Valkey itself. And in one round it lost 3.8 % of the messages, while the memory engine delivered every message in every round.
A forum reader doesn’t notice a median of 7 ms against 36 ms for a new post appearing. They do notice a post that arrives seconds late or never arrives. A better median doesn’t make up for a worse tail and lost messages.
Why it’s removed and not just off#
My rule for a default is at least 2 % faster somewhere and slower nowhere. The Valkey engine isn’t faster where it counts, so it was never going to become the default. I also removed it as an option, for two reasons:
So
engine=valkeyis gone.setup.sh --centrifugoalways uses Centrifugo’s in-process memory engine, and Valkey stays on its unix socket only.This is a single-node answer#
The memory engine works because one Centrifugo serves every socket. With two or more Centrifugo nodes, a message published on one node has to reach sockets on the others, and that needs a shared broker such as Redis or Valkey. The memory engine can’t do that.
That isn’t my case. My largest boards peak near 10,000 members online, which one node handles, as the table shows. If a board ever outgrows one node, the engine question comes back, and it would need a fresh measurement on whatever Centrifugo version is current then.
What I didn’t measure#