-
Notifications
You must be signed in to change notification settings - Fork 109
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
unified solution for TCP memory limitation #365
Conversation
Signed-off-by: Robin Lu <robin.lu@bytedance.com>
Signed-off-by: Robin Lu <robin.lu@bytedance.com>
Signed-off-by: Robin Lu <robin.lu@bytedance.com>
54c1653
to
5943b21
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #365 +/- ##
==========================================
+ Coverage 53.35% 53.43% +0.07%
==========================================
Files 436 438 +2
Lines 47963 48310 +347
==========================================
+ Hits 25592 25813 +221
- Misses 19490 19579 +89
- Partials 2881 2918 +37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
8e89c3f
to
cad3cb5
Compare
@@ -245,6 +252,11 @@ func (p *DynamicPolicy) Start() (err error) { | |||
go wait.Until(p.setMemoryMigrate, setMemoryMigratePeriod, p.stopCh) | |||
} | |||
|
|||
if p.enableSettingSockMem { |
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.
register as RegisterPeriodicalHandler
will be better
* 2, do nothing for cgroupv2. | ||
* 3, set pod tcp_mem accounting for cgroupv1. | ||
*/ | ||
func (p *DynamicPolicy) setSockMemLimit() { |
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.
will it be better if we add a new dir handlers
for RegisterPeriodicalHandler
? @csfldf
cad3cb5
to
503d2a7
Compare
2d539c5
to
7da0e19
Compare
Signed-off-by: Robin Lu <robin.lu@bytedance.com>
7da0e19
to
a20579b
Compare
What type of PR is this?
Features
What this PR does / why we need it:
The feature provides the unified solution for TCP memory limitation in cgroup and host level.
Which issue(s) this PR fixes:
Special notes for your reviewer:
The feature includes 3 parts:
1, Set the limit value for host net.ipv4.tcp_mem.
The default value is 20% of host toal memory.
2, Do nothing for cgroupv2.
3, Set pod tcp_mem accounting for cgroupv1.
The default value is same with memory.limit_in_bytes.