-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Some fixes about memory stats #418
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
Conversation
Signed-off-by: Qiang Huang <[email protected]>
Signed-off-by: Qiang Huang <[email protected]>
We have no OOM notifications in docker events, now we have OOM stats, so fix the decription. Signed-off-by: Qiang Huang <[email protected]>
I don't see why this should be special, it feels wired in some stat sections such as kernel memory and swap memory which have only Failcnt with 0 value. And this also added unit test cases for failcnt and oom control. Signed-off-by: Qiang Huang <[email protected]>
98c5798
to
462204d
Compare
return getMemoryMappingData(path, "memory.stat") | ||
} | ||
|
||
func getOomStat(path string) (map[string]uint64, error) { |
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 is not really a stat. Why are we overloading the stats API to essentially abstract out cgroups API?
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.
@vishh Why do you think oomStat is not really a stat? From user's point of view, I think it surely is a stat which is also very concerned by users, and all this PR was inspired by help message of runc events
$ runc events --help
NAME:
events - display container events such as OOM notifications, cpu, memory, IO and network stats
USAGE:
command events [command options] [arguments...]
OPTIONS:
--interval "5s" set the stats collection interval
--stats display the container's stats then exit
Which I noticed we don't have oom stats yet but it says we do. (I think original description OOM notifications stats
was meat to be OOM stats
)
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.
Personally oom_control
feels more like Status
rather than Stats
.
On Sun, Dec 20, 2015 at 11:37 PM, Qiang Huang [email protected]
wrote:
In libcontainer/cgroups/fs/memory.go
#418 (comment):
t, v, err := getCgroupParamKeyValue(sc.Text())
if err != nil {
return nil, fmt.Errorf("failed to parse %s (%q) - %v", name, sc.Text(), err)
}
data[t] = v
- }
- return data, nil
+}
+func getMemoryStat(path string) (map[string]uint64, error) {
- // Get stats from memory.stat.
- return getMemoryMappingData(path, "memory.stat")
+}
+func getOomStat(path string) (map[string]uint64, error) {
@vishh https://github.com/vishh Why do you think oomStat is not really
a stat? From user's point of view, I think it surely is a stat which is
also very concerned by users, and all this PR was inspired by help message
of runc events$ runc events --help
NAME:
events - display container events such as OOM notifications, cpu, memory, IO and network statsUSAGE:
command events [command options] [arguments...]OPTIONS:
--interval "5s" set the stats collection interval
--stats display the container's stats then exitWhich I noticed we don't have oom stats yet but it says we do. (I think
original description OOM notifications stats was meat to be OOM stats)—
Reply to this email directly or view it on GitHub
https://github.com/opencontainers/runc/pull/418/files#r48122236.
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.
Yeah I understand, since it's a yes or no, not a number, it looks more like Status
, but it's not the same thing as the states we are implementing in #311
So we end up facing states, status, statistic and events. I don't feel good to mix events and statistic into runc events
, and it seems to be worse to add status in. Do you think we should separate them all? That would be a lot more commands but seems unavoidable.
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.
Why don't we start with separating the CLI from the library APIs. For the library, I'd prefer separating Status, Spec, Stats & Events.
For the CLI, we can choose to either expose all these entities separately or have a get
that exposes minimal information and a detail
or describe
option that exposes all the above.
It's obsolete, closing. |
…ation runtime: Explicitly allow 'start' to not validate config.json
Signed-off-by: Qiang Huang [email protected]