postgresql_cluster icon indicating copy to clipboard operation
postgresql_cluster copied to clipboard

Hetzner server types

Open schonert opened this issue 1 year ago • 3 comments

This is awesome!

Would we be able to add more server types to the hetzner list? https://github.com/vitabaks/postgresql_cluster/blob/c9c9f02d0dd7991e3966f0e6c35dd4f3d3c45af0/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql#L295-L302

I could stitch together a PR - altho not sure if there's a good reason to limit it to these 8.

schonert avatar Oct 09 '24 06:10 schonert

Hi. Yes, we can add other types. Which ones are you interested in?

As far as I recall, all available server types are included, except for shared CPUs, which were not added because they are not recommended for production use.

Additionally, you can modify or add types in the database of your console installation.

vitabaks avatar Oct 09 '24 07:10 vitabaks

I was interested in beefier shared CPUs. So CX32 and above, CPX31 and above, and CAX21 and above.

Not under the impression that they are not recommended for production?

Additionally, you can modify or add types in the database of your console installation.

Arhh great point!

schonert avatar Oct 09 '24 09:10 schonert

I see that only 6 types of servers are present with a dedicated CPU:

image

All of them are in the console database.

I was interested in beefier shared CPUs. So CX32 and above, CPX31 and above, and CAX21 and above.

Servers with shared vCPUs are not suitable for production databases because they do not guarantee consistent performance. Virtual CPUs on these servers are shared among multiple virtual machines, which can lead to unpredictable delays and reduced speed under heavy workloads. This is particularly critical for databases, where steady access to resources is essential to ensure low-latency responses and stable performance under load.

I could stitch together a PR - altho not sure if there's a good reason to limit it to these 8.

Yes, we could add all available types (with the exception of arm, since its support has not yet been implemented), but in this case it is necessary to explicitly mark the "Shared vCPU" types in the UI.

vitabaks avatar Oct 09 '24 10:10 vitabaks

Feel free to suggest a PR

cc @schonert @nelsonic

vitabaks avatar Dec 09 '24 09:12 vitabaks

I got sidetracked.

... it is necessary to explicitly mark the "Shared vCPU" types in the UI.

I was put off by the suggestion to add mark in the UI - not that I disagree. It would require me to look into how to best add an additional field to the database and then later populate the frontend.

Altho, thinking about it again, made me realise that we could just add it to the instance_name. Eg. CCX63 (Shared vCPU). Agree?

schonert avatar Dec 09 '24 13:12 schonert

Yes, I would really like to mark shared vCPU in the user interface so that users do not accidentally choose this type for production.

Related PR https://github.com/vitabaks/autobase/pull/835

vitabaks avatar Dec 09 '24 14:12 vitabaks

If we agree that the Shared vCPU / Dedicated vCPU string should be added to the instance_name, ➕ happy to include it in my current PR #835 so it's one-and-done. :shipit:

nelsonic avatar Dec 11 '24 08:12 nelsonic

#835 contains the (Shared vCPU) / (Dedicated vCPU) string in instance_name via https://github.com/nelsonic/autobase/commit/223570990762b6cfc5e5ec9f174743047856182a 👌

nelsonic avatar Dec 11 '24 08:12 nelsonic

As noted by @vitabaks in https://github.com/vitabaks/autobase/pull/835#discussion_r1879623345, 💬 we cannot change the instance_name to include the additional string as it will mess with deployment. 👎 i.e. hetzner API will not recognise "CX22 (Shared vCPU Intel)" when attempting to create a VPS. 🚫

So will revert that last commit. ♻️

Instead, proposing adding the new shared_cpu field to public.cloud_instances as:

ALTER TABLE ONLY public.cloud_instances
ADD COLUMN 'shared_cpu' BOOLEAN DEFAULT FALSE;

Then setting the boolean as V has suggested. 👌

nelsonic avatar Dec 11 '24 08:12 nelsonic

Please see: https://github.com/vitabaks/autobase/pull/835/commits/025bbd3839a22d12dfee23a694f6f91711fef65f 🙏

nelsonic avatar Dec 11 '24 09:12 nelsonic

#835 merged. :shipit:

@schonert pls check if this resolves your OP. 🤞

nelsonic avatar Dec 12 '24 10:12 nelsonic