8000 allow usage of suffix `b` in startup option values (#1253) · konsultaner/arangodb-docs@45fa801 · GitHub
[go: up one dir, main page]

Skip to content

Commit 45fa801

Browse files
jsteemannSimran-Bnerpaula
authored
allow usage of suffix b in startup option values (arangodb#1253)
* allow usage of suffix `b` in startup option values * Review, add release notes Co-authored-by: Simran Spiller <simran@arangodb.com> Co-authored-by: Paula Mihu <97217318+nerpaula@users.noreply.github.com>
1 parent e40b7d6 commit 45fa801

File tree

4 files changed

+65
-24
lines changed

4 files changed

+65
-24
lines changed

3.10/programs-arangod-env-vars.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ title: arangod environment variables
1111

1212
This variable can be used to override the automatic detection of the total
1313
amount of RAM present on the system. One can specify a decimal number
14-
(in bytes). Furthermore, if `G` or `g` is appended, the value is multiplied
15-
by `2^30`. If `M` or `m` is appended, the value is multiplied by `2^20`.
16-
If `K` or `k` is appended, the value is multiplied by `2^10`. That is,
17-
`64G` means 64 gigabytes.
14+
(in bytes). Furthermore, numbers can have the following suffixes:
15+
16+
- `GB`, `G`, `gb`, `g`: the number is multiplied by 1,000,000,000 (gigabytes).
17+
- `MB`, `M`, `mb`, `m`: the number is multiplied by 1,000,000 (megabytes).
18+
- `KB`, `K`, `kb`, `k`: the number is multiplied by 1,000 (kilobytes).
19+
- `GIB`, `GiB`, `gib`: the number is multiplied by 1,073,741,824 (gibibytes).
20+
- `MIB`, `MiB`, `mib`: the number is multiplied by 1,048,576 (mebibytes).
21+
- `KIB`, `KiB`, `kib`: the number is multiplied by 1,024 (kibibytes).
1822

1923
The total amount of RAM detected is logged as an INFO message at
2024
server start. If the variable is set, the overridden value is shown.
@@ -30,7 +34,21 @@ title: arangod environment variables
3034
2. If `arangod` is running alongside other services on the same
3135
machine and thus sharing the RAM with them, one should limit the
3236
amount of memory using this environment variable.
33-
37+
38+
Note that setting this environment variable mainly affects the default
39+
values of startup options that have to do with memory usage.
40+
If the values of these startup options are explicitly set anyway, then
41+
setting the environment variable has no effect.
42+
43+
For example, the default value for the RocksDB block cache size
44+
(`--rocksdb.block-cache-size` startup option) depends on the amount of
45+
available memory. If you set `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY=32GB`,
46+
the default value for the block cache size is `(32GB - 2GB) * 0.3 = 9GB`.
47+
However, if you set the `--rocksdb.block-cache-size` startup option explicitly
48+
via a configuration file or via the command-line, then the latter value is
49+
used, and not the option's default value based on the
50+
`ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` environment variable.
51+
3452
- `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` _(introduced in v3.7.1)_
3553

3654
This variable can be used to override the automatic detection of the

3.11/administration-configuration.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,19 @@ Specific to arangod, move to programs detail page?
173173
Does the resolution order for config files apply to all binaries?
174174
Linux only? Also macOS? Windows not addressed so far.
175175

176-
If this command is not passed to the server, then by default, the server will
177-
attempt to first locate a file named *~/.arango/arangod.conf* in the user's home
176+
If this command is not passed to the server, then by default, the server
177+
attempts to first locate a file named `~/.arango/arangod.conf` in the user's home
178178
directory.
179179

180-
If no such file is found, the server will proceed to look for a file
181-
*arangod.conf* in the system configuration directory. The system configuration
180+
If no such file is found, the server proceeds to look for a file
181+
`arangod.conf` in the system configuration directory. The system configuration
182182
directory is platform-specific, and may be changed when compiling ArangoDB
183-
yourself. It may default to */etc/arangodb* or */usr/local/etc/arangodb*. This
183+
yourself. It may default to `/etc/arangodb` or `/usr/local/etc/arangodb`. This
184184
file is installed when using a package manager like rpm or dpkg. If you modify
185185
this file and later upgrade to a new version of ArangoDB, then the package
186186
manager normally warns you about the conflict. In order to avoid these warning
187187
for small adjustments, you can put local overrides into a file
188-
*arangod.conf.local*.
188+
`arangod.conf.local`.
189189
{% endcomment %}
190190

191191
## Suffixes for Numeric Options
@@ -200,6 +200,7 @@ in megabytes, gigabytes, or terabytes.
200200
| `mib`, `MiB`, `MIB` | 1024<sup>2</sup> | 1,048,576 | `64mib` |
201201
| `gib`, `GiB`, `GIB` | 1024<sup>3</sup> | 1,073,741,824 | `3GIB` |
202202
| `tib`, `TiB`, `TIB` | 1024<sup>4</sup> | 1,099,511,627,776 | `3tib` |
203+
| `b`, `B` | 1 | 1 | `10b` |
203204
| `k`, `K`, `kb`, `KB` | 1000 | 1,000 | `3k` |
204205
| `m`, `M`, `mb`, `MB` | 1000<sup>2</sup> | 1,000,000 | `3M` |
205206
| `g`, `G`, `gb`, `GB` | 1000&l 6D40 t;sup>3</sup> | 1,000,000,000 | `3GB` |
@@ -286,29 +287,29 @@ level = startup=info
286287
There are built-in defaults, with which all configuration variables are first
287288
initialized. They can be overridden by configuration files and command line
288289
options (in this order). Only a fraction of all available options are set in
289-
the configuration files that ArangoDB ships with. Many options will therefore
290+
the configuration files that ArangoDB ships with. Many options therefore
290291
fall back to the built-in defaults unless they are overridden by the user.
291292

292293
It is common to use modified configuration files together with startup
293294
options on a command line to override specific settings. Command line options
294295
take precedence over values set in a configuration file.
295296

296297
If the same option is set multiple times, but only supports a single value,
297-
then the last occurrence of the option will become the final value.
298-
For example, if you edit `arangosh.conf` to set:
298+
then the last occurrence of the option becomes the final value.
299+
For example, if you edit `arangosh.conf` as follows:
299300

300-
```
301+
```conf
301302
server.database = myDB1
302303
server.database = myDB2
303304
```
304305

305-
… and start ArangoShell like:
306+
Then start ArangoShell like this:
306307

307308
```
308309
arangosh --server.database myDB3 --server.database myDB4
309310
```
310311

311-
… then the database it will connect to is `myDB4`, because this startup option
312+
The database it connects to is `myDB4`, because this startup option
312313
takes a single value only (i.e. it is not a vector), the built-in default
313314
is `_system` but the configuration file overrules the setting. It gets set to
314315
`myDB1` temporarily before it is replaced by `myDB2`, which in turn gets

3.11/programs-arangod-env-vars.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@ title: arangod environment variables
1111

1212
This variable can be used to override the automatic detection of the total
1313
amount of RAM present on the system. One can specify a decimal number
14-
(in bytes). Furthermore, if `G` or `g` is appended, the value is multiplied
15-
by `2^30`. If `M` or `m` is appended, the value is multiplied by `2^20`.
16-
If `K` or `k` is appended, the value is multiplied by `2^10`. That is,
17-
`64G` means 64 gigabytes.
14+
(in bytes). Furthermore, numbers can have the following suffixes:
15+
16+
- `TB`, `T`, `tb`, `t`: the number is multiplied by 1,000,000,000,000 (terabytes).
17+
- `GB`, `G`, `gb`, `g`: the number is multiplied by 1,000,000,000 (gigabytes).
18+
- `MB`, `M`, `mb`, `m`: the number is multiplied by 1,000,000 (megabytes).
19+
- `KB`, `K`, `kb`, `k`: the number is multiplied by 1,000 (kilobytes).
20+
- `TIB`, `TiB`, `tib`: the number is multiplied by 1,099,511,627,776 (tebibytes).
21+
- `GIB`, `GiB`, `gib`: the number is multiplied by 1,073,741,824 (gibibytes).
22+
- `MIB`, `MiB`, `mib`: the number is multiplied by 1,048,576 (mebibytes).
23+
- `KIB`, `KiB`, `kib`: the number is multiplied by 1,024 (kibibytes).
24+
- `B`, `b`: bytes
1825

1926
The total amount of RAM detected is logged as an INFO message at
2027
server start. If the variable is set, the overridden value is shown.
21-
Various default sizes are calculated based on this value (e.g.
28+
Various default sizes are calculated based on this value (e.g. the
2229
RocksDB buffer cache size).
2330

2431
Setting this option can in particular be useful in two cases:
@@ -30,7 +37,21 @@ title: arangod environment variables
3037
2. If `arangod` is running alongside other services on the same
3138
machine and thus sharing the RAM with them, one should limit the
3239
amount of memory using this environment variable.
33-
40+
41+
Note that setting this environment variable mainly affects the default
42+
values of startup options that have to do with memory usage.
43+
If the values of these startup options are explicitly set anyway, then
44+
setting the environment variable has no effect.
45+
46+
For example, the default value for the RocksDB block cache size
47+
(`--rocksdb.block-cache-size` startup option) depends on the amount of
48+
available memory. If you set `ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY=32GB`,
49+
the default value for the block cache size is `(32GB - 2GB) * 0.3 = 9GB`.
50+
However, if you set the `--rocksdb.block-cache-size` startup option explicitly
51+
via a configuration file or via the command-line, then the latter value is
52+
used, and not the option's default value based on the
53+
`ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY` environment variable.
54+
3455
- `ARANGODB_OVERRIDE_DETECTED_NUMBER_OF_CORES` _(introduced in v3.7.1)_
3556

3657
This variable can be used to override the automatic detection of the

3.11/release-notes-new-features311.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ on startup, all SST files in the `engine-rocksdb` folder in the database
4242
directory are validated, then the process finishes execution.
4343
The default value is `false`.
4444

45-
### Support for terabyte and tebibyte suffixes
45+
### Support for additional value suffixes
4646

4747
Numeric startup options support suffixes like `m` (megabytes) and `GiB` (gibibytes)
4848
to make it easier to specify values that are expected in bytes. The following
4949
suffixes are now also supported:
5050

5151
- `tib`, `TiB`, `TIB`: tebibytes (factor 1024<sup>4</sup>)
5252
- `t`, `tb`, `T`, `TB`: terabytes (factor 1000<sup>4</sup>)
53+
- `b`, `B`: bytes (factor 1)
5354

5455
Example: `arangod --rocksdb.total-write-buffer-size 2TiB`
5556

0 commit comments

Comments
 (0)
0