Repository navigation
feat(servers): move the live web servers to cx43, one server per apply - #44
Merged
Merged
Conversation
…nd read health per server The provider powers a server off to change its type and does not start it again. hcloud load-balancer list shows mixed for a label selector whatever the health.
Pin the version kamal app start uses, shut down before the apply, merge right before the rollout, cover a failed apply, and check capacity first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The live web servers need more memory. Each cx33 (8 GB) runs Puma (4g limit, about 3.5 GB in use) and a Sidekiq worker (3g limit). On 2026-10-17 a large ship-views import ran the workers out of memory and the kernel killed them. After the app-side fixes, a single-ship import still peaks at about 2.6 GB per worker, which leaves too little room for the worker or the host. This moves both web servers to cx43 (16 GB, 8 vCPU), one per apply. The accessories server stays on cx33.
Cost: +€7.50/month net per web server, so +€15.00 net (+€17.86 gross) for both.
Changes
web_server_types(one per web server) andaccessories_server_typereplace the sharedserver_type. Changing the shared value would have rescaled the accessories server as well, and an apply rescales every changed server at once, taking both web servers down together. A validation requires one type per web server.["cx43", "cx33"], so this PR's apply rescales onlyweb-1. A follow-up PR changes it to["cx43", "cx43"]forweb-2.keep_disk = trueon both server resources, so a rescale doesn't grow the disk. With a larger disk, the server could never move back to cx33.MAINTENANCE.mdhas a new rolling rescale runbook: take the server out of the load balancer, stop its containers, apply, power it back on, start the containers again.Expected live plan
hcloud_server.web_server[0]:server_typecx33 → cx43,keep_disk→ true, and itshttplabel coming back (removed in rollout step 1), an in-place update.hcloud_server.web_server[1]andhcloud_server.accessory_server[0]:keep_disk→ true only, which changes nothing on the servers.Rollout
The full steps and the failure path are in
MAINTENANCE.md, under "Rescaling Web Servers (Live)". In short:Merge this right before the rollout, and run no other live apply until it's done. Once it's on
main, the next live apply of any kind powers offweb-1, even with its app running. Hold merges in the app repo, and pick a window clear of the heavy scheduled jobs (late morning on a weekday looks clearest).hcloud server-type describe cx43, to check it shows as available in the location.kamal app version -d live --hosts 178.104.132.157, from the app repo, and note the version.hcloud server remove-label fltyrd-live-web-1 http, which takes it out of the load balancer.kamal app stop -d live --hosts 178.104.132.157.hcloud server shutdown fltyrd-live-web-1, then wait for it to be off.live, check the plan against the list above, and apply.hcloud server poweron fltyrd-live-web-1, then wait for SSH. Provider v1.70.2 has no power-on in this path.kamal app start -d live --hosts 178.104.132.157 --version=<version>, then wait for the target to report healthy. Without--version, Kamal uses your local git HEAD.The runbook's commands weren't run as part of this PR: they take effect on the real rollout.
Testing
terraform fmt -check,terraform validateandterraform testpass (3 runs). One new run checks the per-server types, the accessories type andkeep_disk; another checks that a type list shorter than the server count is rejected.🤖