-
Notifications
You must be signed in to change notification settings - Fork 31
CLOS-3583: Update physical memory limit documentation #281
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| ``` | ||
| </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. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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`. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be too late to ask, but why did we decide to make it configurable via 2 CLI tools instead of only one? :)
There was a problem hiding this comment.
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