Skip to content

Type a word or two, like firewall or rollback.

Open Coresmith
Browse the docs
Reference Checked against Coresmith 0.8.20.

Sizes and PHP limits

Open as Markdown

Sizes

An app's size caps the memory each of its processes may use, and for PHP apps how many requests run at once.

SizeMemory per processPHP workers
Small, side projects256 MB5
Medium, production512 MB15
Large, heavy traffic1 GB30

New apps start on Small, except Ruby and Java apps, which start on Medium. Change the size on the app's page at any time.

Python apps run 2, 4 or 8 web workers on Small, Medium and Large, and their Celery worker runs as many processes. Set WEB_CONCURRENCY in the app's environment to change the web workers.

Ruby apps run one web process on every size, since a Puma config that starts a worker per processor would outgrow it. Set WEB_CONCURRENCY in the app's environment to run more.

A size sets a cap, and reserves nothing, so several apps can share a server as long as what they really use fits in its memory.

When an app runs out of memory

A process that goes past its memory is stopped and started again. If it keeps happening right after a deploy, the deploy fails with an out-of-memory message, and Coresmith emails the people who get server alerts. Pick a bigger size, or find what's using the memory.

PHP limits

Every PHP app has four limits, on the PHP limits card on its page. They apply to everything the app runs in PHP: the website, queue workers, cron jobs and deploy steps. Saving a change applies it without a deploy, and requests already running finish first.

LimitNew apps start atChoices
Uploads up to64 MB per request8 MB to 1 GB
Memory per processHalf of what the size allows: 128 MB on Small, 256 MB on Medium, 512 MB on Large64 MB up to what the size allows
Web requests stop after60 seconds30 seconds to 5 minutes
New code loadsAt each deploy for Laravel and Symfony, every 2 seconds for other PHP appsAt each deploy, or every 2 seconds
  • Uploads: the limit covers the whole request. A request that arrives over a slow connection has up to 5 minutes to finish arriving.
  • Memory: a process that needs more than its limit stops with PHP's "Allowed memory size exhausted" error.
  • Web requests: a request that runs past its limit is stopped, even one waiting on a slow database. Queue workers and cron jobs aren't timed.
  • New code: at each deploy is faster. Pick every 2 seconds if the app writes its own PHP files while it runs, as WordPress does when it updates plugins.