Skip to main content
Open console

Service settings

The settings each service takes from vallic.yaml, what they do, and what stays with the platform.

13 min read

Each service beside your site (the database, the cache, Nginx, PHP itself) takes a few settings, such as the largest upload Nginx lets through or how long a PHP request may run. Set them in vallic.yaml, under the service they belong to.

runtime:
  php: '8.4'

services:
  - mariadb:
      version: '11.8'
      environment:
        MYSQL_MAX_ALLOWED_PACKET: 256M
        MYSQL_SLOW_QUERY_LOG: '1'
  - nginx:
      version: '1.31'
      environment:
        NGINX_CLIENT_MAX_BODY_SIZE: 64m
  - php:
      version: '8.4'
      environment:
        PHP_MAX_EXECUTION_TIME: '120'
        PHP_UPLOAD_MAX_FILESIZE: 64M
        PHP_POST_MAX_SIZE: 64M

Every entry under services needs a version, php included. Which PHP runs is still runtime.php, so keep the two the same.

These are not project variables: your application reads a project variable, and a service setting changes the service.

For one environment

vallic.yaml is the same for every environment that deploys it. To give one environment a value of its own, set it on that environment's Variables page, under Service settings. Use it for a staging account for the mail relay, or a larger upload limit on one site.

  • It replaces the file's value on that environment and nowhere else.
  • The rules below apply: only the settings a service takes, each value checked.
  • It reaches the service when you apply the change, or with the next deploy.
  • Remove it and the file's value, or the platform's default, applies again.
  • The page says where each value in effect comes from.

A variable with the same name does nothing for the service. It reaches your application only, and the Variables page marks it as a service's setting.

The rules

Only the settings listed below. A deploy that sets anything else refuses, naming the variable and what the service does take. Nothing is accepted and quietly ignored.

Each value is checked. A number setting takes a number, a size takes a size, and a pattern takes only the characters a pattern needs. A value of the wrong shape refuses the deploy, naming it. Each value is one line of text, at most 1,024 characters. A $ is a dollar sign: values are never expanded, so one setting cannot read another, or anything else on the machine.

They take effect on the next deploy. A service whose settings changed is restarted with them before your code lands. Delete a line and the next deploy puts the default back.

Background work gets the application's settings. The queue worker, your workers and your scheduled jobs run with whatever you set on php.

Memory is sized from your machine. The platform sets the database's buffer pool, the cache's limit, Solr's heap, Varnish's storage and PHP's APCu from what you run on.

Where the service runs Memory it gets
A machine of its own Most of the machine: a cache alone on its machine gets 80%, the database 60%
A machine it shares with your site A share of your plan, so it can never grow into the memory your site needs

You can set those listed below lower: the buffer pool, PostgreSQL's shared buffers, Solr's heap and APCu. A higher value is lowered to your share. The cache's limit and Varnish's storage are not settings: they are only ever sized.

Production shows no errors on the page. On a production environment PHP does not print errors, startup errors or failed assertions into the response. They still go to the logs. Other environments behave as the image does. Set PHP_DISPLAY_ERRORS if you want something else.

PHP's memory limit is held to your plan. PHP_MEMORY_LIMIT follows the same rule as runtime.memory_limit: anything above what your plan allows is lowered to it. If the file sets both, runtime.memory_limit wins.

Timeouts are a chain. A request passes through Nginx and, if you run it, Varnish before it reaches PHP. Whichever gives up first answers. Raise PHP_MAX_EXECUTION_TIME and NGINX_FASTCGI_READ_TIMEOUT together. With Varnish in front, a page still has 60 seconds to start answering, whatever the other two say. Work that takes longer belongs in a worker.

Your code is never checked for changes while it runs. A deploy switches to the new release and reloads PHP, which empties its cache of compiled code. The check is off everywhere, and there is no setting for it.

Every setting, by service

A service missing from this list takes no settings. Its page says why.

Bun — bun

Variable What it does Unless you set it
BUN_OPTIONS Arguments put before every Bun command, such as --smol for a smaller heap. Debugger flags are refused. the image's
BUN_CONFIG_MAX_HTTP_REQUESTS How many outgoing HTTP requests fetch makes at once. 256

Go — golang

Variable What it does Unless you set it
GOMEMLIMIT A soft memory limit for the Go runtime, such as 900MiB. the image's
GOMAXPROCS How many threads run Go code at once. the image's

InfluxDB — influxdb

Variable What it does Unless you set it
INFLUXD_LOG_LEVEL How much the server logs: debug, info or error. info
INFLUXD_SESSION_LENGTH Minutes a web interface session lasts. 60
INFLUXD_SESSION_RENEW_DISABLED Stops a session being extended while it is used. false
INFLUXD_QUERY_QUEUE_SIZE How many queries may wait for a turn. 1024
INFLUXD_INFLUXQL_MAX_SELECT_POINT The most points an InfluxQL SELECT may read; 0 is no limit. 0
INFLUXD_INFLUXQL_MAX_SELECT_SERIES The most series an InfluxQL SELECT may read; 0 is no limit. 0
INFLUXD_INFLUXQL_MAX_SELECT_BUCKETS The most GROUP BY time buckets an InfluxQL SELECT may make; 0 is no limit. 0
INFLUXD_STORAGE_WRITE_TIMEOUT How long a write may take before it fails. 10s

MariaDB — mariadb

Variable What it does Unless you set it
MYSQL_MAX_ALLOWED_PACKET The largest single query or row, such as 256M. 256M
MYSQL_INNODB_BUFFER_POOL_SIZE The database's cache of tables and indexes. Sized from the database's share of the machine unless you set it lower. sized from your machine
MYSQL_MAX_CONNECTIONS Connections at once. Each one costs memory whether it is busy or not. 100
MYSQL_SLOW_QUERY_LOG 1 to log queries slower than MYSQL_LONG_QUERY_TIME. OFF
MYSQL_LONG_QUERY_TIME Seconds after which a query counts as slow. 2

Meilisearch — meilisearch

Variable What it does Unless you set it
MEILI_MAX_INDEXING_MEMORY Memory Meilisearch may use while indexing. the image's
MEILI_LOG_LEVEL How much Meilisearch logs. INFO

MySQL 8 — mysql

Variable What it does Unless you set it
MYSQL_MAX_ALLOWED_PACKET The largest single query or row, such as 256M. 256M
MYSQL_INNODB_BUFFER_POOL_SIZE The database's cache of tables and indexes. Sized from the database's share of the machine unless you set it lower. sized from your machine
MYSQL_MAX_CONNECTIONS Connections at once. Each one costs memory whether it is busy or not. 100
MYSQL_SLOW_QUERY_LOG 1 to log queries slower than MYSQL_LONG_QUERY_TIME. the image's
MYSQL_LONG_QUERY_TIME Seconds after which a query counts as slow. the image's

Nginx — nginx

Variable What it does Unless you set it
NGINX_CLIENT_MAX_BODY_SIZE The largest request body Nginx passes on, such as 64m. Uploads bigger than this never reach PHP. 32m
NGINX_KEEPALIVE_TIMEOUT How long an idle browser connection is kept open. 75s
NGINX_FASTCGI_READ_TIMEOUT How long Nginx waits for PHP to answer, in seconds. 900
NGINX_GZIP_COMP_LEVEL Compression level, 1 to 6. Higher saves bytes and costs CPU on every response. 1
NGINX_STATIC_EXPIRES How long browsers may cache static files, such as 7d. 1y
NGINX_ERROR_LOG_LEVEL How much Nginx logs: error, warn or notice. error
NGINX_DRUPAL_NOT_FOUND_REGEX Drupal presets only: paths matching this regex are answered with 404, so source files such as composer.json or .yml are never served. the image's
NGINX_WP_NOT_FOUND_REGEX WordPress preset only: paths matching this regex are answered with 404, so files such as composer.json or .sql dumps are never served. the image's

Node.js — nodejs

Variable What it does Unless you set it
NODE_OPTIONS Flags for Node itself, such as --max-old-space-size. Debugger flags are refused. the image's

OpenSMTPD — opensmtpd

Variable What it does Unless you set it
RELAY_HOST The SMTP server to send through. Without one, mail leaves from the machine's own address. the image's
RELAY_PORT Its port, usually 587. 587
RELAY_PROTO How to connect to it, such as smtp+tls. smtp+tls
RELAY_USER The user to log in as. The password is a secret project variable, RELAY_PASSWORD, never a line in the file. the image's
OPENSMTPD_MAX_MESSAGE_SIZE The largest message accepted, such as 35M. 35M
OPENSMTPD_EXPIRE How long undeliverable mail is retried before it bounces. 4d
OPENSMTPD_BOUNCE_WARN When the sender is warned that a message is still undelivered. 1h, 6h, 2d

PHP-FPM — php

Variable What it does Unless you set it
PHP_MEMORY_LIMIT Memory one request may use. Held to what your plan allows, and runtime.memory_limit wins when the file sets both. 512M
PHP_MAX_EXECUTION_TIME Seconds a request may run. Nginx and Varnish keep their own clocks. 120
PHP_POST_MAX_SIZE The largest request body PHP accepts. At least PHP_UPLOAD_MAX_FILESIZE, and no more than Nginx's NGINX_CLIENT_MAX_BODY_SIZE. 32M
PHP_UPLOAD_MAX_FILESIZE The largest single uploaded file. 32M
PHP_OPCACHE_MEMORY_CONSUMPTION Megabytes for compiled code. Sized from your plan, a sixteenth of it from 64 up to 2048; set it lower if your codebase is small. sized from your machine
PHP_APCU_SHM_SIZE Shared memory for APCu, the in-process cache. Sized from your plan, 5% of it from 32M up to 1024M, unless you set it lower. sized from your machine
PHP_FPM_PM_MAX_CHILDREN Requests served at once. Each may use up to the memory limit, so this times that has to fit the machine. 8
PHP_DISPLAY_ERRORS Whether errors are printed into pages. Off unless you turn it on, and it should stay off anywhere a visitor can reach. Off on production, On elsewhere
PHP_MAX_INPUT_VARS How many input variables one request may carry. Large forms — Drupal's permissions page, menu editors — need more than the default. 2000

PostgreSQL — postgres

Variable What it does Unless you set it
POSTGRES_MAX_CONNECTIONS Connections at once. 100
POSTGRES_SHARED_BUFFERS PostgreSQL's own cache. Sized from the database's share of the machine unless you set it lower. sized from your machine
POSTGRES_WORK_MEM Memory for one sort or hash — per operation, per connection, so a small number goes a long way. 5MB

Python — python

Variable What it does Unless you set it
WEB_CONCURRENCY How many worker processes Gunicorn (and Uvicorn) start. 2

RabbitMQ — rabbitmq

Variable What it does Unless you set it
RABBITMQ_VM_MEMORY_HIGH_WATERMARK The share of its memory at which RabbitMQ stops accepting messages, such as 0.6. Of the queue machine when it has one, of your plan otherwise. the image's

Redis — redis

Variable What it does Unless you set it
REDIS_MAXMEMORY_POLICY What is evicted when the cache is full: allkeys-lru suits a cache, noeviction a store that must not lose keys. allkeys-lru
REDIS_DATABASES How many numbered databases exist. 16
REDIS_PERSISTENCE What it keeps across a restart: off nothing, snapshots a snapshot every few minutes with eviction kept, store every write and nothing evicted. The platform sets the rest of this section from it, and mounts a data directory where it is not off. off

Ruby — ruby

Variable What it does Unless you set it
WEB_CONCURRENCY How many worker processes Puma forks; unset or 0 runs one process, which is Puma's own default. the image's
RAILS_MAX_THREADS How many threads each Puma process answers with, and the size of Active Record's connection pool, in the files Rails generates. the image's
RAILS_LOG_LEVEL How much Rails logs, in the production.rb Rails 7.1 and later generate: debug, info, warn, error or fatal. the image's

Rust — rust

Variable What it does Unless you set it
RUST_LOG Which log lines env_logger and tracing-subscriber print, such as info or my_app=debug. the image's
RUST_BACKTRACE Whether a panic prints a backtrace: 1, full or 0. the image's

Solr — solr

Variable What it does Unless you set it
SOLR_HEAP Java heap for Solr, such as 1g. Sized from the search machine unless you set it lower. sized from your machine
SOLR_MODULES Solr modules to load, comma-separated, such as extraction,langid. extraction,langid,ltr,analysis-extras

Static site — static

Variable What it does Unless you set it
NGINX_KEEPALIVE_TIMEOUT How long an idle browser connection is kept open. 75s
NGINX_GZIP_COMP_LEVEL Compression level, 1 to 6. Higher saves bytes and costs CPU on every response. 1
NGINX_STATIC_EXPIRES How long browsers may cache static files, such as 7d. 1y
NGINX_ERROR_LOG_LEVEL How much Nginx logs: error, warn or notice. error
NGINX_INDEX_FILE The page a directory serves, such as index.html, or several tried in turn: index.html index.htm. index.html
NGINX_HTML_FALLBACK The page every path with no file loads, answered 200, for a single-page application that routes in the browser: index.html. Unset, such a path is a 404. the image's

Valkey — valkey

Variable What it does Unless you set it
VALKEY_MAXMEMORY_POLICY What is evicted when the cache is full: allkeys-lru suits a cache, noeviction a store that must not lose keys. allkeys-lru
VALKEY_DATABASES How many numbered databases exist. 16
VALKEY_PERSISTENCE What it keeps across a restart: off nothing, snapshots a snapshot every few minutes with eviction kept, store every write and nothing evicted. The platform sets the rest of this section from it, and mounts a data directory where it is not off. off

Vinyl Cache (Varnish) — vinyl

Variable What it does Unless you set it
VARNISHD_PARAM_DEFAULT_TTL How long, in seconds, a page is cached when the application sends no Cache-Control: max-age of its own. 120.000
VARNISH_BACKEND_GRACE How long an expired page may still be served while a fresh copy is fetched in the background, such as 10m. 2m
VARNISH_CACHE_PER_COUNTRY Keep a separate cached copy per visitor country, for sites that vary content by country. Set to 1. the image's
VARNISH_MOBILE_SEPARATE_CASH Keep a separate cached copy for mobile browsers, for sites that render differently on phones. Set to 1. the image's
VARNISH_KEEP_ALL_PARAMS Keep marketing query parameters such as utm_source in the cache key instead of stripping them. Set to 1. the image's

"Unless you set it" is the platform's value where it sets one. Otherwise it is the image's own default.

What stays with the platform

The platform holds every setting not listed here:

  • Where things connect. Hostnames, ports, cluster membership, which backend Varnish sends requests to.
  • Who and where. Users, file ownership and paths. Your code is mounted read-only.
  • Credentials. Database passwords, cache passwords, search admin passwords. They are generated per environment and handed to your application in its environment.
  • What keeps data safe. How the database flushes to disk, where it stores files, and how a cache writes to disk. Whether a cache keeps its data at all is yours: VALKEY_PERSISTENCE and REDIS_PERSISTENCE.
  • Logs. Where logs go and in what format. You read them without changing your code.
  • Admin and debug endpoints. Status pages, debuggers, profilers and cache purging.

If you need one of these changed, ask support at support@vallic.com. Tell us what you are trying to do, not which variable to set.

Need a hand?

Open a ticket from Support in the console. We answer on the ticket.

Open the console How support works