Configuration ABCs
Process configuration
The hpcd binary configuration is in /etc/sysconfig/hpcd
. This file contains information such as the number of CPUs, reserved memory, and whether to use the over-provisioned mode for nonproduction traffic on laptops or VMs.
The following parameters may be changed.
-
--smp
controls the number of worker loaded (by default, one per CPU core, it can be lowered but never configured to more than the number of CPU cores) (e.g.,--smp 32
). -
--cpuset
controls the number of worker loaded, as an alternative to--smp
but with control on which CPU cores are used (e.g.,--cpuset 0-31
) -
--logger-log-level bpkcache=warn:hpcd=warn
allows to alter the log level of various subsystems -
--overprovisionned
allows to enable the over-provisioned mode, which is helpful for nonproduction traffic on laptops or VMs -
--etcd-endpoints localhost:2379 --etcd-root-prefix hpcd
allows enabling the etcd connector if used. More details are provided in the view chapter.
IMPORTANT
For a demo setup, in a VM or a laptop, remove
--lock-memory true and add --overprovisionned
EdgePeak configuration
The core hpcd configuration file is /etc/broadpeak/hpc/hpcd.conf
. This file contains most of the configuration.
Whenever you edit that file, you can use /usr/sbin/hpcd --test
to validate the configuration file. The command hpc-ctl edit
performs edit and validation steps in a single command line.
Editing & Validating Configuration
An all-in-one utility is available for editing config, validating it, and reformatting it if valid.
hpc-ctl config edit
Using an alternate editing workflow, validating configuration syntax without loading it or impacting a running daemon is possible using the following commands. The last command also dumps a json corresponding to the interpreted configuration, which can be helpful in complex configurations with conditional parts or leverage built-in templating capabilities to understand which vhosts and upstreams are declared.
hpc-ctl config validate /usr/sbin/hpcd --test /usr/sbin/hpcd --dump | jq '.'
The configuration file can be automatically reformatted to ensure consistency and ease of later edits.
hpc-ctl config reformat\`
Updated 3 days ago