summaryrefslogtreecommitdiff
path: root/docs/configuration/system/option.md
blob: ecb3853b70f431e87dd15420bf44808337cf1b55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
(system-option)=

# Option

This chapter describe the possibilities of advanced system behavior.

## General

```{cfgcmd} set system option ctrl-alt-delete \<ignore | reboot | poweroff\>

Action which will be run once the ctrl-alt-del keystroke is received.
```

```{cfgcmd} set system option reboot-on-panic

Automatically reboot system on kernel panic after 60 seconds.
```

```{cfgcmd} set system option reboot-on-upgrade-failure \<timeout\>

Automatically reboot after `timeout` minutes into the previous running
image, that was used to perform the image upgrade.

Reboot `timeout` is configurable in minutes. This gives the user the change
to log into the system and perform some analysis before automatic rebooting.

Automatic reboot can be cancelled after login using: {opcmd}`reboot cancel`
```

```{cfgcmd} set system option startup-beep

Play an audible beep to the system speaker when system is ready.
```

```{cfgcmd} set system option root-partition-auto-resize

Enables the root partition auto-extension and resizes to the maximum
available space on system boot.
```


### Kernel

```{cfgcmd} set system option kernel disable-mitigations

Disable all optional CPU mitigations. This improves system performance,
but it may also expose users to several CPU vulnerabilities.

This will add the following option to the Kernel commandline:
* ``mitigations=off``

:::{note}
Setting will only become active with the next reboot!
:::
```

```{cfgcmd} set system option kernel disable-power-saving

This will add the following two options to the Kernel commandline:
* ``intel_idle.max_cstate=0`` Disable intel_idle and fall back on acpi_idle
* ``processor.max_cstate=1`` Limit processor to maximum C-state 1

:::{note}
Setting will only become active with the next reboot!
:::
```

```{cfgcmd} set system option kernel amd-pstate-driver \<mode\>

Enables and configures p-state driver for modern AMD Ryzen and Epyc CPUs.

The available modes are:
* ``active`` This is the low-level firmware control mode based on the profile
set and the system governor has no effect.
* ``passive`` The driver allows the system governor to manage CPU frequency
while providing available performance states.
* ``guided`` The driver allows to set desired performance levels and the firmware
selects a performance level in this range and fitting to the current workload.

This will add the following two options to the Kernel commandline:
* ``initcall_blacklist=acpi_cpufreq_init`` Disable default ACPI CPU frequency scale
* ``amd_pstate={mode}`` Sets the p-state mode

:::{note}
Setting will only become active with the next reboot!
:::

:::{seealso}
<https://docs.kernel.org/admin-guide/pm/amd-pstate.html>
:::
```

```{cfgcmd} set system option kernel quiet

Suppress most kernel messages during boot. This is useful for systems with
embedded serial console interfaces to speed up the boot process.
```


### Kernel crash dump (kdump)

kdump is a kernel crash dumping mechanism that captures the contents of
system memory when a kernel panic occurs. The capture is performed by a
second, minimal kernel (the capture kernel) that is loaded into a reserved
memory region at boot time. When the main kernel panics, the capture kernel
runs and saves the memory image (vmcore) to disk for later analysis.

:::{note}
kdump requires VyOS to be installed to disk. It is not available in
live-boot mode.
:::

:::{note}
Changes to kdump settings take effect only after a system reboot.
:::

#### Configuration

```{cfgcmd} set system option kdump memory \<size | auto\>

**Reserve memory for the kdump capture kernel in megabytes.**

The size can be specified in the next format:
a single amount (e.g., `512`).

Setting this option to `auto` (default) applies
the following reservations:

:::{list-table}
:header-rows: 1

* - **System RAM**
  - **Reserved memory**
  - **Notes**
* - less than 1 GB
  - 0 MB
  - On systems with less than 1 GB of RAM, `auto` reserves no memory
    and kdump is not active. Set an explicit size to enable kdump on
    such systems.
* - 1 GB – 8 GB
  - 512 MB
  -
* - 8 GB – 64 GB
  - 768 MB
  -
* - 64 GB and above
  - 1 GB
  -
:::
```
Example:
```none
set system option kdump memory 512
set system option kdump memory auto
```

```{cfgcmd} set system option kdump dump-path \<path\>

**Configure the directory where crash dumps (vmcore files) are saved
after a panic.**
The path must be absolute (begin with `/`).

Defaults to `/var/crash`.
```
Example:
```none
set system option kdump dump-path /var/log/kdump
```

#### Operation

```{opcmd} show system kdump

Display the kdump service operational status and configuration summary.
```

```{opcmd} show system kdump dumps

List all recorded kernel crash dumps under the configured dump path.
Each entry shows the dump directory, combined size (vmcore + dmesg) and
capture timestamp.
```


## HTTP client

```{cfgcmd} set system option http-client source-address \<address\>

Several commands utilize cURL to initiate transfers. Configure the local
source IPv4/IPv6 address used for all cURL operations.
```

```{cfgcmd} set system option http-client source-interface \<interface\>

Several commands utilize curl to initiate transfers. Configure the local
source interface used for all CURL operations.
```

:::{note}
`source-address` and `source-interface` can not be used at the same
time.
:::

## SSH client

```{cfgcmd} set system option ssh-client source-address \<address\>

Use the specified address on the local machine as the source address of the
connection. Only useful on systems with more than one address.
```

```{cfgcmd} set system option ssh-client source-interface \<interface\>

Use the address of the specified interface on the local machine as the
source address of the connection.
```


## Keyboard Layout

When starting a VyOS live system (the installation CD) the configured keyboard
layout defaults to US. As this might not suite everyone's use case you can adjust
the used keyboard layout on the system console.

```{cfgcmd} set system option keyboard-layout \<us | fr | de | fi | no | dk\>

Change system keyboard layout to given language.

Defaults to ``us``.

:::{note}
Changing the keymap only has an effect on the system console, using
SSH or Serial remote access to the device is not affected as the keyboard
layout here corresponds to your access system.
:::
```

(system-options-performance)=

## Performance

As more and more routers run on Hypervisors, especially with a {abbr}`NOS
(Network Operating System)` as VyOS, it makes fewer and fewer sense to use
static resource bindings like `smp-affinity` as present in VyOS 1.2 and
earlier to pin certain interrupt handlers to specific CPUs.

We now utilize `tuned` for dynamic resource balancing based on profiles.

:::{seealso}
<https://access.redhat.com/sites/default/files/attachments/201501-perf-brief-low-latency-tuning-rhel7-v2.1.pdf>
:::

```{cfgcmd} set system option performance \< throughput | latency \>

Configure one of the predefined system performance profiles.

* ``throughput``: A server profile focused on improving network throughput.
  This profile favors performance over power savings by setting
  ``intel_pstate`` and ``max_perf_pct=100`` and increasing kernel network
  buffer sizes.

  It enables transparent huge pages, and uses cpupower to set the performance
  cpufreq governor. It also sets ``kernel.sched_min_granularity_ns`` to 10 us,
  ``kernel.sched_wakeup_granularity_ns`` to 15 uss, and ``vm.dirty_ratio`` to
  40%.

* ``latency``: A server profile focused on lowering network latency.
  This profile favors performance over power savings by setting
  ``intel_pstate`` and ``min_perf_pct=100``.

  It disables transparent huge pages, and automatic NUMA balancing. It also
  uses cpupower to set the performance cpufreq governor, and requests a
  cpu_dma_latency value of 1. It also sets busy_read and busy_poll times to
  50 us, and tcp_fastopen to 3.
```