Skip to content

Conversation

ajaysundark
Copy link
Contributor

@ajaysundark ajaysundark commented Jun 29, 2025

Description

feat: Add blog post on Linux Swap Tuning for Kubernetes

This PR introduces a blog post on optimizing Linux swap utilization within Kubernetes environments.

Abstract:

This blog post will provide a comprehensive guide to understanding and tuning critical Linux kernel parameters related to swap, including min_free_kbytes, watermark_scale_factor and swappiness. It will explore how these parameters directly influence Kubernetes workload performance, memory management, and crucial eviction mechanisms. We will present detailed test results showcasing the impact of various configurations, highlight the significant risks associated with incorrect swap tuning (such as inadvertently disabling evictions or impacting OOM Killer behavior), and share our findings on achieving optimal settings for stable and high-performing Kubernetes clusters.

Issue

KEP: kubernetes/enhancements#2400
Closes: #51153

@k8s-ci-robot k8s-ci-robot added this to the 1.34 milestone Jun 29, 2025
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 29, 2025
@k8s-ci-robot k8s-ci-robot added area/blog Issues or PRs related to the Kubernetes Blog subproject language/en Issues or PRs related to English language size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 29, 2025
Copy link

netlify bot commented Jun 29, 2025

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit 2e8d68e
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-vnext-staging/deploys/68912d0b95cede0008507732

@ajaysundark ajaysundark changed the title [en] Add blog post on tuning linux kernel paremeters for swap [en] Add blog post on tuning linux kernel parameters for swap Jun 29, 2025
@lmktfy
Copy link
Contributor

lmktfy commented Jun 30, 2025

Great. Would you like to buddy with another blog article author @ajaysundark ?

@ajaysundark
Copy link
Contributor Author

Thanks @lmktfy . From the blog guidelines, I understand the buddy assists with draft review and feedback on the article. Does it make sense for me to seek buddy assistance / review here after the initial draft is ready?

@iholder101
Copy link
Contributor

/cc

@k8s-ci-robot k8s-ci-robot requested a review from iholder101 July 1, 2025 17:27
@aibarbetta
Copy link
Member

Hi @HirazawaUi @ajaysundark 👋 this is Agus from the v1.34 Communications Team!

@HirazawaUi as author of #51529, I'd like you to be a writing buddy for @ajaysundark on this PR.

Please:

  • Review this PR, paying attention to the guidelines and review hints
  • Update your own PR based on any best practices you identify that should be applied
  • Remember to be compassionate with your fellow article author

@aibarbetta
Copy link
Member

/sig release

@k8s-ci-robot k8s-ci-robot added the sig/release Categorizes an issue or PR as relevant to SIG Release. label Jul 13, 2025
@dipesh-rawat
Copy link
Member

Hi 👋, v1.34 Communications Team here again!

Since the KEP didn’t meet the code freeze deadline and has been removed from the v1.34 milestone (based on kubernetes/enhancements#2400 (comment)), this KEP won’t be part of the upcoming release.

@ajaysundark, to keep things clear and streamlined, I recommend closing this PR for now. We’d definitely encourage revisiting it in a future cycle when the KEP is back on track.

Looping in @aibarbetta (v1.34 Comms lead) to keep the team aligned. Thanks so much!

@ajaysundark
Copy link
Contributor Author

Exception request for KEP-2400 approved: https://groups.google.com/g/kubernetes-sig-node/c/IGF6v3G9lds, and Node Memory Swap support is continued to be tracked for 1.34 GA.

@dipesh-rawat
Copy link
Member

Exception request for KEP-2400 approved: https://groups.google.com/g/kubernetes-sig-node/c/IGF6v3G9lds, and Node Memory Swap support is continued to be tracked for 1.34 GA.

@ajaysundark Thanks for the update! Since the KEP exception request is currently pending final approval from the Release Team, we’re happy to keep this PR open for now. Once it’s approved and the KEP-2400 is added back to the milestone, we can move forward with the blog.

@ajaysundark
Copy link
Contributor Author

Hi @dipesh-rawat / @aibarbetta - now that NodeSwap feature is tracked for v1.34, could you please include this for 1.34 blog scope too?

@dipesh-rawat
Copy link
Member

Hi @ajaysundark 👋, v1.34 Communications Team here again!

Now that exception is sorted for the KEP, this is already being considered for the feature blog for v1.34 release.

Just a friendly reminder that we are approaching the feature blog "Ready for review" deadline: Friday 8th August 2025. We ask you to have the blog in non-draft state, and all write-up to be complete.

If you have any questions or need help, please don't hesitate to reach out to me or any of the Communications Team members. We are here to help you!

@ajaysundark
Copy link
Contributor Author

ajaysundark commented Aug 1, 2025

Thank you @dipesh-rawat, I'm looking into it. I'll have the draft ready soon, and sync with my buddy review @HirazawaUi .

Copy link
Member

@dipesh-rawat dipesh-rawat left a comment

Choose a reason for hiding this comment

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

@ajaysundark Please update the PR to merge into main instead of dev.1-34.
The workflow for feature blog posts differs from the one used for upcoming release changes and new features.
You can find the relevant details here.

@ajaysundark
Copy link
Contributor Author

Thanks @dipesh-rawat , I'll update this PR to target main.

Hi @HirazawaUi - Would you be available to review https://hackmd.io/@ajaysundark/rJEhBDRExl for your thoughts?
If you suggest it could be better at github, I could update the draft here for comments.

@ajaysundark ajaysundark force-pushed the blog-swap-fine-tuning branch from a5a83e5 to 2e8d68e Compare August 4, 2025 21:58
@k8s-ci-robot k8s-ci-robot added area/localization General issues or PRs related to localization area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes labels Aug 4, 2025
@ajaysundark
Copy link
Contributor Author

Thanks for working on this further.

I'm trying to strike the right balance between giving you your authentic voice as a blog author, but also not taking too many shortcuts with the facts and specifics.

How would you like to move this article forward, given that feedback? I think it's just not quite there for me to merge it right now.

Thanks for your review, sharing many critical details and depths at the draft. I addressed many of your feedback.
One aspect I'm unsure about is on the Windows swap claims we could mention at this blog. Since NodeSwap feature (and the experiments performed as discussed here) is explicitly targeted at Linux nodes, I'm vary of mixing the details. I would prefer to exclude Windows discussion here. Wdyt?

@lmktfy
Copy link
Contributor

lmktfy commented Aug 13, 2025

One aspect I'm unsure about is on the Windows swap claims we could mention at this blog. Since NodeSwap feature (and the experiments performed as discussed here) is explicitly targeted at Linux nodes, I'm vary of mixing the details. I would prefer to exclude Windows discussion here

If we don't mention Windows nodes, there is a risk of misleading people: they may think that what they read in the article applies to all nodes, regardless of node OS.

One potential way to avoid that: explain that the article is only about swap on Linux nodes.

@ajaysundark ajaysundark force-pushed the blog-swap-fine-tuning branch from a75dcf6 to 9e10476 Compare August 14, 2025 04:27
@ajaysundark
Copy link
Contributor Author

One aspect I'm unsure about is on the Windows swap claims we could mention at this blog. Since NodeSwap feature (and the experiments performed as discussed here) is explicitly targeted at Linux nodes, I'm vary of mixing the details. I would prefer to exclude Windows discussion here

If we don't mention Windows nodes, there is a risk of misleading people: they may think that what they read in the article applies to all nodes, regardless of node OS.

One potential way to avoid that: explain that the article is only about swap on Linux nodes.

Got it. Thanks, that makes sense. I updated the draft to explicitly state that the post is about Linux nodes, setting the context right from the start. Please take a look.

@ajaysundark
Copy link
Contributor Author

/cc @SergeyKanzhelev

Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

lgtm with couple of comments

@ajaysundark ajaysundark force-pushed the blog-swap-fine-tuning branch from 9e10476 to f107d4a Compare August 17, 2025 04:37
@ajaysundark
Copy link
Contributor Author

Hi @lmktfy - Do you have more feedback for me here?

@ajaysundark ajaysundark requested a review from lmktfy August 17, 2025 04:38
Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 18, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: aaa4c46926d11a8fa741be2d019facde4b4187ea

Copy link
Contributor

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

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

I propose to tweak the wording just slightly.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 19, 2025
@lmktfy lmktfy removed this from the 1.34 milestone Aug 19, 2025
Copy link
Contributor

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 19, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5315dc78c78bc8483a7b9a6a2439bc33b4e71296

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lmktfy, SergeyKanzhelev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2025
@k8s-ci-robot k8s-ci-robot merged commit 4f97476 into kubernetes:main Aug 19, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/blog Issues or PRs related to the Kubernetes Blog subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation updates for k8s Node swap monitoring and troubleshooting. Target: 1.34
9 participants