FLAT
CouperSevenval TechnologiesDocker ImageGithub
master
master
  • Changelog
  • FLAT
  • Administration
    • Configuration
    • Docker
    • Logging
  • Cookbook
    • Using the Built-in Mocking
    • Performing Additional Checks on JWT Access Tokens
    • Logging Custom Fields
    • Using Environment Variables
    • Handling Errors with an Error Flow
    • File Serving
    • Forwarding a Request to an Upstream API
    • Extracting Common Initialization Flow Tasks
    • Encoding and Decoding JWT
    • Passing Header Fields to the Client
    • How can I pass an arbitrary header field to an upstream system?
    • Performing Additional Checks on JWT Access Tokens
    • Proxying requests to Upstream APIs
    • Increasing the Request Timeout
    • How can I see what the client requested?
    • Using Swagger UI for API Documentation
    • Testing API Requests
    • Testing with Backend Requests
    • Testing Templates
    • Sending POST Requests
    • Processing Upstream Responses
    • Protecting Access using JWT Tokens
  • Reference
    • Configuration
    • Debugging
    • flat CLI
    • Flow
    • Variables
    • OpenAPI / Swagger Integration
    • OpenAPI
      • CORS - Cross-Origin Resource Sharing
    • OpenAPI
      • Differences from Swagger
    • OpenAPI
      • Mocking
    • OpenAPI
      • Routing
    • OpenAPI
      • Security
    • OpenAPI
      • Upstream APIs
    • OpenAPI
      • Validation
    • Flow Actions
      • assert Action
      • auth Action
      • backend-flow Action
      • copy Action
      • debug Action
      • dump Action
      • echo Action
      • error Action
      • eval Action
      • log Action
      • nameshave Action
      • pass-body Action
      • proxy-request Action
      • regex Action
      • request Action
      • requests Action
      • serve Action
      • set-config Action
      • set-env Action
      • set-response-headers Action
      • set-status Action
      • sub-flow Action
      • template Action
      • test-request Action
      • xslt Action
    • Functions
      • apply-codecs()
      • array-reverse()
      • array()
      • base64-decode()
      • base64-encode()
      • body()
      • calc-signature()
      • capitalize-first()
      • content()
      • decrypt-xml()
      • decrypt()
      • encrypt()
      • ends-with()
      • file-exists()
      • fit-document()
      • fit-log()
      • fit-serialize()
      • get-log()
      • has-class()
      • html-parse()
      • join()
      • json-doc()
      • json-parse()
      • json-stringify()
      • json-to-csv()
      • json-to-xml()
      • jwt-decode()
      • jwt-encode()
      • ldap-lookup()
      • ldap-query()
      • lookup()
      • matches()
      • md5()
      • replace()
      • sort()
      • split()
      • tolower()
      • toupper()
      • trim()
      • unixtime()
      • urldecode(), url-decode()
      • urlencode(), url-encode()
      • uuid3() and uuid4()
      • verify-signature()
      • verify-xmldsig()
      • xml-parse()
      • xml-to-json()
    • Templating
      • {{,}}
      • Comment {{// …}}
      • Dot {{.}}
      • Conditional `{{if <condition>}} … {{elseif <condition> }} … {{else}} … {{end}}
      • loop
      • ?? Operator
      • Object XML Notation (OXN)
      • Pair Producer {{: …}}
      • Placeholder
      • Template Variables
      • with
    • Testing
  • Tutorial
Powered by GitBook
On this page
  • Environment Variables
  • Miscellaneous
  • Request Timeouts
  • php.ini
  • PHP-FPM
  • See also

Was this helpful?

  1. Administration

Configuration

PreviousAdministrationNextDocker

Last updated 4 years ago

Was this helpful?

Certain settings of the FLAT server can be configured using environment variables. The chapter 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 as $server/role.

  • FLAT_STATUS_AUTH: Username and password, separated by a : for access to the php-fpm and httpd status pages. The pages are disabled entirely if FLAT_STATUS_AUTH is not set. If enabled, the httpd status can be requested via HTTP at /ServerStatus, and the php-fpm status at /FPMStatus?full.

  • FLAT_DEBUG_ALLOW_HEADER: enable , defaults to false unless FLAT_DEBUG_AUTH is set.

  • FLAT_DEBUG_AUTH: sets a password to protect .

  • FIT_FLAT_UID_FORMAT: use uuid3 or uuid4 to switch the format of the requestID generated in the logs and the id 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 .

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 of FLAT_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

PHP-FPM

  • FLAT_FPM_MAX_PROCESSES: Controls pm.max_children. Default 100.

  • FLAT_FPM_MAX_REQUESTS: Controls pm.max_requests. Default 500. Limits the number of requests each child process executes before it is replaced by a new process.

  • FLAT_FPM_MIN_SPARE: Controls pm.min_spare_servers. Default 5. The desired minimum number of idle child processes to be created.

  • FLAT_FPM_MAX_SPARE: Controls pm.max_spare_servers. Default 7. The desired maximum number of idle child processes.

  • FLAT_FPM_START_SERVERS: Controls pm.start_servers. The default is the average of pm.min_spare_servers and pm.min_spare_servers. The initial number of child processes to be started.

See also

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 for a list of directives.

Some parameters used for PHP-FPM process management can be adjusted using environment variables. Refer to the for more information.

(Cookbook)

PHP documentation
PHP-FPM documentation
per request debugging
per request debugging
$server variable
Setting Envvars
Defining Env Vars
request option