Files
poseidon/docs/configuration.md

2.3 KiB

Configuration

Poseidon can be configured to suit different use cases.

Poseidon

The file config/config.go contains a configuration struct containing all possible configuration options for Poseidon. The file also defines default values for most of the configuration options.
The options can be overridden with a yaml configuration file whose path can be configured with the flag -config. By default, Poseidon searches for configuration.yaml in the working directory. configuration.example.yaml is an example for a configuration file and contains explanations for all options. The options can also be overridden by environment variables. Currently, only the Go types string, int, bool and struct (nested) are implemented. The name of the environment variable is constructed as follows: POSEIDON_(<name of nested struct>_)*<name of field> (all letters are uppercase).

The precedence of configuration possibilities is:

  1. Environment variables
  2. Configuration file
  3. Default values

If a value is not specified, the value of the subsequent possibility is used.

Example

  • The default value for the Port (type int) field in the Server field (type struct) of the configuration is 7200.

  • This can be overwritten with the following configuration.yaml:

    server:
      port: 4000
    
  • Again, this can be overwritten by the environment variable POSEIDON_SERVER_PORT, e.g., using export POSEIDON_SERVER_PORT=5000.

Nomad

As a subsystem of Poseidon, Nomad can and should also be configured accordingly.

Scheduler

By default, Nomad uses a bin-packing scheduler. This places all Jobs on one host. In our case, a high load then leads to one Nomad client being fully utilised while the others remain mostly idle. To mitigate the overload of a Nomad client, the "spread" scheduler algorithm should be used.

Maximum Connections per Client

By default, Nomad only allows 100 maximum concurrent connections per client. However, as Poseidon is a client, this would significantly impair and limit the performance of Poseidon. Thus, this limit should be disabled.

To do so, ensure the following configuration is set in your Nomad agents, for example by adding it to /etc/nomad.d/base.hcl:

limits {
    http_max_conns_per_client = 0
}