Skip to content

Size Cap Web's Railway limits to its real use, with headroom - #20

Merged
hjescalona merged 2 commits into
smgfrom
internal/cap-web-limits
Nov 13, 2026
Merged

hjescalona merged 2 commits into
smgfrom
internal/cap-web-limits

Conversation

@hjescalona

@hjescalona hjescalona commented Nov 13, 2026 •

Copy link
Copy Markdown

Lowers Cap Web's per-replica limit in .railway/railway.ts (Railway IaC) from 32 vCPU / 12 GB to 8 vCPU / 6 GB.

Why these numbers (Railway metrics, 2026-11-06 to 11-13):

Normal use (last 72 h) Peak (week, during the Loom import)
Memory 0.86 GB average, 1.27 GB max 6.8 GB
CPU 0.005 vCPU average, 0.05 max 2 vCPU

The goal is headroom, not the minimum:

  • 6 GB of memory is about 4.5x normal use.
  • 8 vCPU is 4x the week's peak. CPU above use costs nothing, while a CPU limit throttles, so it gets the most room.

Railway bills usage, not the limit, so this caps how far a leak or a runaway job can go rather than lowering the bill.

Order matters. The Node heap was capped at 8 GB, above the new limit, so NODE_OPTIONS is already set to --max-old-space-size=4096 in Railway, and Cap Web was redeployed with it before this merges. For another bulk import, raise both together.

Same pass, done in the dashboard because those services are outside the cap-web partial:

  • MySQL: 2 vCPU / 2 GB. INNODB_BUFFER_POOL_MB=512 replaces the 15 GB buffer pool Railway's wrapper sized from the 32 GB container. mysqld went from 2.26 GB to 414 MB.
  • Cap Media Server: 8 vCPU / 8 GB. Its import peak was 6.7 vCPU and 3 GB.

A week of metrics puts Cap Web at about 1.3 GB and 0.05 vCPU at normal
peaks, and 6.8 GB and 2 vCPU during the Loom import. Lower the limit
from 32 vCPU / 12 GB to 4 vCPU / 4 GB. NODE_OPTIONS now caps the Node
heap at 3 GB (set in Railway) so the heap stays under the new limit.
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Railway config plan

1 change will apply on merge.

~ Update Cap Web deploy.limitOverride.containers.cpu, deploy.limitOverride.containers.memoryBytes
Pinned plan — what merge will apply
.railway/ tree ef97d291d0ed7e58458ccdc964b5c50868a6fff4
Environment etag aae6be872a8bbea2194b5b4d413826bc29a6f96e20be31e4077e64b37c5daaa3
Change-set hash sha256:f7f4f379996210273f15ca731a0f74816cfe62bb27d29b15ad24fe5633492699
Environment c69cb47f-c519-443a-b063-866b813005f3
CLI 5.74.0

Merge applies exactly this change set. If the environment moves or .railway/ changes first, the apply fails and the PR needs a fresh plan.

Posted by railwayapp/config · Railway Infrastructure as Code

8 vCPU / 6 GB instead of 4 vCPU / 4 GB, with the Node heap at 4 GB, so
normal peaks and moderate bulk work never get throttled. CPU above use
costs nothing.
@hjescalona hjescalona changed the title Size Cap Web's Railway limits to its real use Size Cap Web's Railway limits to its real use, with headroom Nov 13, 2026
@hjescalona
hjescalona merged commit d22528f into smg Nov 13, 2026
7 checks passed
@hjescalona
hjescalona deleted the internal/cap-web-limits branch November 13, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant