Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update descriptions of --memory and --reserve-memory #326

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions operator/api/redpanda/v1alpha2/redpanda_clusterspec_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1010,16 +1010,19 @@ type Memory struct {
Redpanda *RedpandaMemory `json:"redpanda,omitempty"`
}

// RedpandaMemory allows you to optionally specify the memory size for both the Redpanda process and the underlying reserved memory used by Seastar. This section is omitted by default, and memory sizes are calculated automatically based on container memory. Configuring this section and setting `memory` and `reserveMemory` values will disable automatic calculation.
// If you are setting the following values manually, keep in mind the following guidelines. Getting this wrong may lead to performance issues, instability, and loss of data: The amount of memory to allocate to a container is determined by the sum of three values:
// RedpandaMemory allows you to optionally specify the memory size for the Redpanda process, including the Seastar subsystem. By default, this section is omitted, and memory sizes are calculated automatically based on the container's total memory allocation. When you configure this section and manually set the memory and reserveMemory values, the automatic calculation is disabled.
//
// 1. Redpanda (at least 2Gi per core, ~80% of the container's total memory)
// 2. Seastar subsystem (200Mi * 0.2% of the container's total memory, 200Mi < x < 1Gi)
// 3. Other container processes (whatever small amount remains)
// If you are setting these values manually, follow these guidelines carefully. Incorrect settings can lead to performance degradation, instability, or even data loss. The total memory allocated to a container is determined as the sum of the following two areas:
//
// - Redpanda (including Seastar):
// Defined by the `--memory` parameter. Includes the memory used by the Redpanda process and the reserved memory allocated for Seastar. A minimum of 2Gi per core is required, and this value typically accounts for ~80% of the container’s total memory. For production, allocate at least 8Gi.
//
// - Operating system (OS):
// Defined by the `--reserve-memory` parameter. Represents the memory available for the operating system and other processes within the container.
type RedpandaMemory struct {
// Memory for the Redpanda process. This must be lower than the container's memory (`resources.memory.container.min` if provided, otherwise `resources.memory.container.max`). Equivalent to `--memory`. For production, use 8Gi or greater.
Memory *resource.Quantity `json:"memory,omitempty"`
// Memory reserved for the Seastar subsystem. Any value above 1Gi will provide diminishing performance benefits. Equivalent to `--reserve-memory`. For production, use 1Gi.
// Memory reserved for the OS. Any value above 1Gi will provide diminishing performance benefits. Equivalent to `--reserve-memory`. For production, use 1Gi.
ReserveMemory *resource.Quantity `json:"reserveMemory,omitempty"`
}

Expand Down
16 changes: 8 additions & 8 deletions operator/config/crd/bases/cluster.redpanda.com_redpandas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6654,10 +6654,10 @@ spec:
anyOf:
- type: integer
- type: string
description: Memory reserved for the Seastar subsystem.
Any value above 1Gi will provide diminishing performance
benefits. Equivalent to `--reserve-memory`. For
production, use 1Gi.
description: Memory reserved for the OS. Any value
above 1Gi will provide diminishing performance benefits.
Equivalent to `--reserve-memory`. For production,
use 1Gi.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
Expand Down Expand Up @@ -16444,10 +16444,10 @@ spec:
anyOf:
- type: integer
- type: string
description: Memory reserved for the Seastar subsystem.
Any value above 1Gi will provide diminishing performance
benefits. Equivalent to `--reserve-memory`. For
production, use 1Gi.
description: Memory reserved for the OS. Any value
above 1Gi will provide diminishing performance benefits.
Equivalent to `--reserve-memory`. For production,
use 1Gi.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
Expand Down