Configuration
Certain settings of the FLAT server can be configured using environment variables. The chapter Defining Env Vars in the Cookbook provides information on how to set environment variables.
Environment Variables
Miscellaneous
FLAT_SERVER_ROLE
: This setting is typically used to distinguish production systems from staging or development servers. Its value is accessible in the$server
variable as$server/role
.FLAT_STATUS_AUTH
: Username and password, separated by a:
for access to thephp-fpm
andhttpd
status pages. The pages are disabled entirely ifFLAT_STATUS_AUTH
is not set. If enabled, thehttpd
status can be requested via HTTP at/ServerStatus
, and the php-fpm status at/FPMStatus?full
.FLAT_DEBUG_ALLOW_HEADER
: enable per request debugging, defaults tofalse
unlessFLAT_DEBUG_AUTH
is set.FLAT_DEBUG_AUTH
: sets a password to protect per request debugging.FIT_FLAT_UID_FORMAT
: useuuid3
oruuid4
to switch the format of therequestID
generated in the logs and theid
in the DC to UUID version 3 or 4 respectively instead of the Apache httpd unique_id used by default.
Request Timeouts
Note that the maximum allowed overall time for a given request is always limited by FLAT_MAX_TIMEOUT
. All other timeouts can be individually adjusted for each request using the appropriate request option.
Use the following environment variables to configure the timeouts used during requests:
FLAT_DEFAULT_TIMEOUT
: Default timeout in seconds for outgoing HTTP requests.FLAT_DEFAULT_CONNECT_TIMEOUT
: Default connection timeout in seconds for outgoing HTTP requests. If set to 0, the value ofFLAT_DEFAULT_TIMEOUT
is used.FLAT_DEFAULT_TTFB_TIMEOUT
: Maximum time in seconds for receiving the first byte.FLAT_MAX_TIMEOUT
: Maximum allowed time in seconds for outgoing HTTP requests.FLAT_MAX_TIMEOUT_PROCESSES
: Specifies how many PHP-FPM processes are allowed to wait for slow sources at any one time. The lower the threshold value, the earlier slow sources will be blocked.
php.ini
Arbitrary directives can be merged into php.ini
by setting environment variables starting with PHP_INI_
. For example, to set post_max_size = 100M
, just export PHP_INI_post_max_size=50M
in your shell before starting flat
CLI. Refer to the PHP documentation for a list of directives.
PHP-FPM
Some parameters used for PHP-FPM process management can be adjusted using environment variables. Refer to the PHP-FPM documentation for more information.
FLAT_FPM_MAX_PROCESSES
: Controlspm.max_children
. Default100
.FLAT_FPM_MAX_REQUESTS
: Controlspm.max_requests
. Default500
. Limits the number of requests each child process executes before it is replaced by a new process.FLAT_FPM_MIN_SPARE
: Controlspm.min_spare_servers
. Default5
. The desired minimum number of idle child processes to be created.FLAT_FPM_MAX_SPARE
: Controlspm.max_spare_servers
. Default7
. The desired maximum number of idle child processes.FLAT_FPM_START_SERVERS
: Controlspm.start_servers
. The default is the average ofpm.min_spare_servers
andpm.min_spare_servers
. The initial number of child processes to be started.
See also
Setting Envvars (Cookbook)
Last updated