Skip to content

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

Closed
wants to merge 4 commits into from

Conversation

hqhq
Copy link
Contributor

@hqhq hqhq commented Nov 25, 2015

  • Refactor GetStats for memory
  • Add oom stat to MemoryStats
  • Fix description about runc events
  • Omit Failcnt in json

Signed-off-by: Qiang Huang [email protected]

hqhq added 4 commits November 26, 2015 10:44
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]>
return getMemoryMappingData(path, "memory.stat")
}

func getOomStat(path string) (map[string]uint64, error) {
Copy link
Contributor

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?

Copy link
Contributor Author

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)

Copy link
Contributor

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 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)


Reply to this email directly or view it on GitHub
https://github.com/opencontainers/runc/pull/418/files#r48122236.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@crosbymichael crosbymichael modified the milestones: 0.0.8, 0.0.9 Feb 4, 2016
@crosbymichael crosbymichael removed this from the 0.0.9 milestone Mar 10, 2016
@hqhq
Copy link
Contributor Author

hqhq commented Mar 7, 2017

It's obsolete, closing.

@hqhq hqhq closed this Mar 7, 2017
@hqhq hqhq deleted the hq_add_oom_stat branch March 7, 2017 07:54
stefanberger pushed a commit to stefanberger/runc that referenced this pull request Sep 8, 2017
…ation

runtime: Explicitly allow 'start' to not validate config.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants