Skip to content

Commit 3643bfc

Browse files
authored
Merge pull request #3535 from olehermanse/limits
Added limits to documentation
2 parents acca8d3 + c39a1ff commit 3643bfc

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

content/reference/limits.markdown

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
layout: default
3+
title: Limits
4+
categories: [Reference, Limits]
5+
---
6+
7+
There are various limits enforced in CFEngine, for names and values in both policy, web UI, and other places.
8+
It can sometimes be relevant for both developers and users to know what limits are in place.
9+
The term limits is used broadly, referring to different kinds of limits (character limits, rate limits, allowed / blocked characters, etc.).
10+
11+
## Limits in policy language and evaluation
12+
13+
**Variable names:** Maximum 1024 characters.
14+
15+
**Variable values (strings):** No explicit maximum, we've tested strings of several megabytes, however this is not recommended for several reasons:
16+
17+
- When strings get excessively long, everything you do with them takes a long time.
18+
To test this and give some kind of idea: parsing and storing a ~3MB string in a variable took 25 seconds on the author's laptop.
19+
- If you want to include these variables in reporting data, they will be truncated.
20+
(See below for details).
21+
- Any time you print such a variable, there will be a lot of output.
22+
(And printing this data to file or console is also slow).
23+
- `cf-agent` will exit if you create variables so large that you run out of memory.
24+
- Historically, some built-in functions in policy language have truncated strings (usually to around 4K bytes).
25+
This is not intended / desirable, we are fixing those, but it might be relevant for you, especially if you use older versions of CFEngine.
26+
27+
For these reasons, we recommend keeping both variable names and values (strings) to less than 1000 bytes.
28+
If you need more, and you're okay with them being truncated in the reporting data, larger strings should also work well.
29+
You can, for example, try to stay within 16K, it should not be particularly slow.
30+
31+
## Limits in reporting data
32+
33+
Each entity reported (such as a variable or class), including metadata about it, needs to fit within a 4096 byte network "transaction".
34+
35+
**Variables:** Maximum 4078 bytes combined for namespace, bundle name, variable name, variable value, and tags.
36+
The last 18 bytes up to 4096 are a timestamp, and the separators added between the fields.
37+
38+
**Classes:** Maximum 4080 bytes combined for class name and tags.
39+
The last 16 bytes are used for a timestamp and the separators.
40+
41+
## Limits in Web UI and Rest API
42+
43+
**URLs:** The URLs used in settings for LLMs and CFEngine Build projects are limited to 2048 characters.
44+
45+
**Group names:** Maximum 100 characters.
46+
47+
**Passwords:** Maximum 20 characters.
48+
49+
### CMDB / group data / host specific data
50+
51+
**Names:** Maximum 255 characters.
52+
53+
**Values:** Maximum 16 000 characters (16k).
54+
55+
## Limits in CFEngine Build
56+
57+
**Module names:** Maximum 64 characters.
58+
Lowercase ASCII alphanumericals, starting with a letter, and possible singular dashes in the middle.
59+
Uppercase letters and other symbols are not permitted.
60+
61+
**Build steps:** Maximum 256 characters.
62+
63+
**Filenames:** Maximum 128 characters.
64+
Lowercase and uppercase ASCII letters, dots, dashes, and underscores.
65+
Spaces and other symbols (like slashes, quotes, and semicolons) are not permitted.
66+
67+
<!--
68+
69+
Todos:
70+
71+
Password attempt limits.
72+
2FA attempt limits.
73+
74+
Namespace name length.
75+
Bundle name length.
76+
Qualified name length (namespace:bundle.name).
77+
-->

0 commit comments

Comments
 (0)