You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For more details about OpenShift’s Security Context Constraints (SCCs), refer to
23
23
the [official documentation](https://docs.openshift.com/container-platform/latest/concepts/policy/security-context-constraints.html).
24
+
25
+
## Resource Limits
26
+
27
+
Setting appropriate resource limits is essential to ensure the container behaves reliably, securely, and within predictable boundaries. This aligns with [OWASP
which advises enforcing constraints on memory, CPU, file descriptors, and processes.
30
+
31
+
Container resource limits fall into two main categories:
32
+
33
+
### Process-Level Limits (`ulimit`)
34
+
35
+
These limits apply at process level inside the container and are enforced via the Linux `ulimit` mechanism (i.e., `RLIMIT_*`). The following values are
36
+
recommended:
37
+
38
+
*`nofile` (maximum number of open files): `16384`
39
+
*`nproc` (maximum number of processes): `4096`
40
+
*`core` (core dump size): `0`
41
+
42
+
These settings are generous and suitable for most workloads. You may consider tightening them further based on actual usage, after proper testing and
43
+
monitoring.
44
+
45
+
While a high `nproc` limit is typically safe, be aware that it can occasionally trigger unexpected
46
+
behavior depending on the container runtime or host configuration. For further details, see
47
+
the [Docker documentation on `nproc` usage](https://docs.docker.com/reference/cli/docker/container/run/#for-nproc-usage).
48
+
49
+
Setting `core` to `0` disables core dumps, which can consume significant disk space and potentially expose sensitive information. This is especially important
50
+
in production environments where security and data confidentiality are critical.
51
+
52
+
### System Resource Limits (Cgroups)
53
+
54
+
System-level resource limits control the overall consumption of CPU and memory by the container. These constraints are enforced by the Linux kernel using
55
+
control groups (cgroups), ensuring that containers operate within defined boundaries and do not exhaust host resources.
56
+
57
+
#### Recommended Settings
58
+
59
+
*`memory` (maximum memory): At least **6 GB to 10 GB**, depending on the expected load. For detailed guidance, refer
60
+
to [PaperMC’s memory recommendations](https://docs.papermc.io/paper/aikars-flags/#recommended-memory).
61
+
*`cpu` (CPU allocation): Allocate **2 to 4 cores** as a baseline. Actual needs may vary depending on the number of players, active plugins, world complexity,
62
+
and other workload characteristics.
63
+
64
+
Cgroup limits are especially important in multi-tenant environments or orchestrated systems like Kubernetes, where resource isolation, predictability, and
65
+
fairness across containers are critical for system stability.
0 commit comments