A lot of CPU cores or fast cores?

Our community has high traffic spikes based on real world events. Ice hockey games to be exact, that result about 1000 messages to a dedicated topic in about 2,5…3 hours. As discussed in another topic, we have trouble dealing with the spikes.

This has lead me into prospecting other hosting options, on a limted budget. The target is around 50€ per month. The market has evolved since the last time I have studied the offers.

  • For just 42€ you can get a dedicated box from Hetzner, with Ryzen 5 3600 CPU. That is a pretty powerful CPU with 6 cores. As it happens, I have a similar CPU on this laptop, and it can perform single-thread crunching about 40…50% faster than a typical well performing VPS.
  • But in the same price range you can buy a VPS that has a huge number of cores, with somewhat lesser performance. Contabo gives you 10 cores for just 27$ and Hetzer comes with up to 16 cores at 62€. And these are just examples, many other providers out there.

These offers left me wondering, what kind of core setup is ideal for Discourse, in terms of maximizing the peak output? Fewer with higher performance, or a lot of them?

I tried searching for this, and mostly found my old posts :slight_smile: . I recall this was a topic that came up here and there in the early days, but has not been thoroughly discussed recently. A lot of code has changed over the years, so perhaps the behavior of the software or generic recommendations have as well?

6 Likes

You’re right it’s old posts but the trend seems consistent :thinking:

How about a scalable instance for the game nights ? With a little down time it’s easy to backup and spin larger or smaller. I had a similar problem with a jitsi instance (great component BTW :smile:) , most of the time it sat on its hands, but few times a week…

5 Likes

It’s hard to provide guidance without knowing exactly what is the current bottleneck you face.

Using Prometheus exporter plugin for Discourse can show exactly what of the many components is the problem.

7 Likes

Even though I introduced our case in the OP, the intention was to discuss this on the generic level. I may be on the hosting market in the mid-term future, regardless whether I have our root case identified or not.

For Discourse, you should favor fast cores over more cores. If you can get both, that’s even better (for load scenarios). But in the typical case, 2 fast cores will do better overall than 4 slow cores.

We tend to measure this in build time, here are some examples. But any single threaded benchmark will also do.

Ideally you want a build time under 4 minutes (240 seconds).

8 Likes

I’m no expert on the subject, but I’m not sure the virtual cores of a VPS are comparable at all to physical cores of a CPU. I guess that to have a broad approximation, you could look at the amount of RAM offered, and assume they run these VPS on a 256 Mo computer. Contabo with their “10 (virtual) cores” offers 60 Mo of RAM. They probably run 4 of these on something approx. equivalent to the Hetzner dedicated server you mention (a server with 256 Mo). So, I would assume the “10 (virtual) cores” are approx a quarter of the performance of the “6 (physical) cores”. Let’s say half tops if they run 2 of them on a 128 Mo computer (which may have a better or slower CPU than the Hetzner machine, who knows).

(You can really only compare “virtual cores” between the different VPS offers of the same provider. I’m not even sure it makes sense for comparisons of VPSes of different providers).

If you want to know for sure, you have to subscribe for 1 month and run a benchmark. Or convince them to run it for you, or offer you a free trial for a short period of time. If it’s really performance you’re after, that’s the real only way to know for VPSes. Or go with a dedicated server where you have more accurate informations.

EDIT: VPS providers like Contabo usually use KVM to do virtualization, and after a search, it indeed seems you can show more “virtual cores” than you actually have physical cores. Example:

Yes, you can configure and run more virtual CPUs than physical cores available. This is an idle Windows Server 2008 (x86, German) KVM guest showing 10 CPUs on a 4-core single-CPU Intel X3210 machine
(source: kvm virtualization - Can KVM CPU assignment count differ from physical hosts CPU count? - Server Fault )

It would make sense they do this seen how much RAM they offer compared to the number of “cores”.

1 Like

As I was looking at this offer; and thinking :face_with_monocle: hum good deal, I saw that the RAM wasn’t ECC, so quick search on the web, and what pops up ? this blog article by Jeff :sweat_smile:
The video of the CPUs made my day…

4 Likes

Oh wow, I’m already hosting with Hetzner but at a higher price point with a slower CPU & less storage than their current Ryzen boxes. This makes it very interesting to switch… thanks for the note!

4 Likes

Thank you for the blog link. That is a good read.

I also agree that video is worth a thousand words and well… also very funny.

2 Likes

Has anybody done some tests with different CPUs regarding the size of L3 cache?

I’ve seen some mentions that Ruby is very demanding for memory. That could give a hint about possible impact of CPU cache size, because Discourse works with large datasets.

I’m deciding on new server and choosing the right CPU. I wonder whether to go with highest clock or take into account also L3 cache size…

Currently I’m looking at Intel® Xeon® E-2174G with 4 cores clocking 3,8GHz and 8MB cache. But there are more expensive options with 12MB or 16MB cache. Are they worth the money?

Thanks!

1 Like

In my experience that will not make a significant difference.

3 Likes