-
Notifications
You must be signed in to change notification settings - Fork 15
Tune kernel memory settings #1315
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||
| # Memory and OOM tuning for embedded network devices | ||||||||||
| # Optimized for systems with 512MB-4GB RAM | ||||||||||
| # Target: Fast and deterministic OOM behavior | ||||||||||
|
|
||||||||||
| # OOM Behavior | ||||||||||
| # Panic on OOM for fast system reset and recovery | ||||||||||
| vm.panic_on_oom=1 | ||||||||||
|
||||||||||
| vm.panic_on_oom=1 | |
| vm.panic_on_oom=1 | |
| # Automatically reboot 10 seconds after a kernel panic for deterministic recovery | |
| kernel.panic=10 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # System Tuning Guide | ||
|
|
||
| ## Memory | ||
|
|
||
| Default memory tuning is defined in `/etc/sysctl.d/vm.conf`, optimized for embedded network devices with 512MB-4GB RAM. | ||
|
||
|
|
||
| ### For Systems with 4GB+ Memory | ||
|
|
||
| Systems with more memory can afford to be less aggressive with cache reclaim. | ||
|
|
||
| ```conf | ||
| # Allow more dirty pages before writeback | ||
| vm.dirty_ratio=15 | ||
| vm.dirty_background_ratio=10 | ||
|
|
||
| # Less aggressive watermark (memory pressure less critical) | ||
| vm.watermark_scale_factor=100 | ||
| ``` | ||
|
|
||
| ### For Systems with Heavy Filesystem Activity | ||
|
|
||
| Unusual for network equipment, but may occur on systems with extensive logging or storage features. | ||
|
|
||
| ```conf | ||
| # Allow more dirty pages for better write batching | ||
| vm.dirty_ratio=20 | ||
| vm.dirty_background_ratio=10 | ||
|
|
||
| # Longer dirty page expiration for write coalescing | ||
| vm.dirty_expire_centisecs=3000 | ||
| ``` | ||
|
|
||
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.
The PR description states the configuration is "optimized for embedded network devices 512MB-8GB of memory" but this file states "512MB-4GB RAM". This inconsistency should be resolved. Based on the documentation file which also mentions "512MB-4GB RAM" and provides separate guidance for "4GB+ Memory", the configuration file appears correct and the PR description may need updating.