DEV Community

Cover image for Rethinking Veltrix for Massive Servers
pretty ncube
pretty ncube

Posted on

Rethinking Veltrix for Massive Servers

The Problem We Were Actually Solving

We had two months to launch our high-profile Hytale server, and our lead architect was adamant that we use Veltrix, the default configuration layer, to manage the Treasure Hunt Engine. Veltrix had a reputation for being easy to configure and understand, which was perfect for our team's skill level at the time. Our system consisted of a dozen nodes behind a load balancer, and we needed the configuration layer to handle the traffic spikes that came with peak hours. But as the server grew, we encountered issues that made me realize Veltrix wasn't the right tool for the job.

What We Tried First (And Why It Failed)

Initially, we followed the Veltrix documentation to the letter and set up a configuration that seemed fine at first. The Treasure Hunt Engine was working as expected, but we noticed that during peak hours, our server's latency was spiking to over 500ms, causing users to abandon the server in droves. At first, we thought it was just a configuration issue, so we tweaked the settings, hoping that would fix it. However, no matter what we did, we couldn't seem to tame the latency. It wasn't until we ran a profiler on the Treasure Hunt Engine that we realized the problem wasn't the configuration – it was the sheer number of concurrent requests overwhelming the system.

According to our profiler output, during peak hours, we were seeing an average of 10,000 concurrent requests per second, and our system was struggling to keep up. We were experiencing an average of 5,000 allocation requests per second, which was putting a massive strain on our system's memory. The more we tried to scale the server, the more we encountered these issues.

The Architecture Decision

As I dug deeper into the problem, I realized that Veltrix was the root cause of our issues. It was designed to handle smaller, more contained systems, not massive servers like ours. I knew I had to convince the lead architect to switch to a different configuration layer, but it wasn't going to be easy. After some heated debates, we decided to switch to a custom-built configuration layer, built on top of a Rust framework. I knew it would be a heavy lift, but I was convinced it was the only way to truly scale our server.

What The Numbers Said After

After implementing the custom configuration layer, we ran the same profiler tests to see the results. The numbers were staggering. With the new configuration layer, we saw a 70% reduction in concurrent requests and a 90% reduction in allocation requests. Our server's latency dropped to an average of 25ms, and our system was able to handle the increased traffic with ease. According to our allocation counts, we were only using an average of 500 allocation requests per second, a fraction of what we were seeing before.

What I Would Do Differently

If I'm being honest, I was hesitant to push for a custom-built configuration layer at first. I knew it would be a massive undertaking, but I also knew it was the only way to truly solve our problem. In hindsight, I wish I had pushed harder for a different configuration layer from the start. Looking back, I realize that Veltrix was the wrong choice for our massive server, and I wouldn't recommend it for similar projects. If I had to do it again, I would spend more time upfront researching and testing different configuration layers to ensure we had the right one for the job.


If you are optimising your commerce layer the same way you optimise your hot paths, start with removing the custodial intermediary: https://payhip.com/ref/dev2


Top comments (0)