Goal
Know which caps StackShift sets, see them in Variables, and override or turn them off.Prerequisites
- A project with a memory limit.
Workflow
1
Open the project and choose Variables.
2
Find the variable marked set by StackShift.
3
To use your own value, edit it and save. It becomes yours and StackShift stops managing it.
4
To turn caps off for the project, delete the variable.
5
Redeploy to apply a change.
On by default
Caps are on for new deploys. They show in Variables as plain variables marked set by StackShift. StackShift never overrides a value you set yourself.Values
- Go: GOMEMLIMIT at 90 percent of the limit.
- Node.js: NODE_OPTIONS=—max-old-space-size at 75 percent of the limit. It also adds —heapsnapshot-signal=SIGUSR2 —diagnostic-dir=/tmp so memory snapshots work.
- Java: JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=75.
- Python with gunicorn or uvicorn, and Ruby with Puma: WEB_CONCURRENCY, the number of workers.
- Laravel Octane: OCTANE_WORKERS.
- PHP-FPM: PHP_FPM_MAX_CHILDREN.
Worker counts
Worker counts are worked out from the limit divided by the memory one worker was measured to use. They are between 1 and 32. They are not set until one worker has been measured, and not when your start command already passes -w or —workers. For PHP-FPM, use the variable in your pool configuration.PHP-FPM pool
Related finding
If a cap is missing, What to improve shows a No runtime cap finding with an Apply button that turns caps on.Expected result
Your app is capped below its limit, or uses the value you chose.
Related guides
Project environment, domains, and previews
Configure the project surfaces that most often decide whether a deployment works after it builds, including runtime shape, domains, previews, and storage.
What to improve
A ranked list of findings for the project. Each says what is wrong, shows the evidence, says what fixing it is worth and gives the steps.
Change memory
Pick a memory size for a service. StackShift marks the size that fits what it measured and shows the price difference.