Skip to content
Merged
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
28 changes: 28 additions & 0 deletions docs/cloudlinuxos/limits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,34 @@ In case of disk cache – if a user is starting to lack physical memory, the mem

When LVE goes over physical memory limit, CloudLinux OS will first free up memory used for disk cache, and if that is not enough, it will kill some of the processes within that LVE, and increment fPMEM counter. This will usually cause web server to serve 500 and 503 errors. Physical memory limit is a much better way to limit memory for shared hosting.

#### Physical memory lower bound

CloudLinux OS allows administrators to configure a lower bound (minimum value) for physical memory (PMEM) limits to prevent setting limits that are too low and could cause application instability. When a lower bound is configured, any attempt to set a PMEM limit below this threshold will be rejected with an error message displayed by CLI tool or CloudLinux Manager UI. This helps ensure that hosting accounts always have sufficient memory allocated for basic application requirements, preventing performance issues and unexpected application failures. The lower bound is enforced **system-wide** and applies to all limit-setting operations, whether performed through command-line tools or control panel integrations.

By default, the PMEM lower bound is not configured.

You can configure the PMEM lower bound using the <span class="notranslate">`lvectl`</span> command:

<div class="notranslate">

```
lvectl --set-pmem-lower-bound 512M

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lvectl

This may be too late to ask, but why did we decide to make it configurable via 2 CLI tools instead of only one? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloudlinux-limits can be used from the CLI, however it is an interface for the UI mainly. It only works with --json flag (for other options as well) and might be useful if in the future we decide to have the ability to set this lower bound from the UI. Initially I implemented it only for lvectl and Roman requested to do the same for cloudlinux-limits

```
</div>

Alternatively, you can use the <span class="notranslate">`cloudlinux-limits`</span> command:

<div class="notranslate">

```
cloudlinux-limits set --pmem-lower-bound 512M --json
```
</div>

The lower bound value accepts standard memory format notations (e.g., <span class="notranslate">`512M`</span>, <span class="notranslate">`1G`</span>, <span class="notranslate">`2048M`</span>).

The configured PMEM lower bound value is stored in the <span class="notranslate">`/etc/sysconfig/limits_lower_bounds`</span> configuration file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to indicate what is the default value out of the box i.e. not configured.


#### Disable Page Cache accounting

Since kmod-lve 2.0-53 (for CL8) and 2.1-17 (for CL9) we have released the new sysctl param `kernel.memstat_nocache`.
Expand Down