Skip to content
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

USHIFT-197: Enable resource accounting in MicroShift systemd service #868

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

oglok
Copy link
Contributor

@oglok oglok commented Aug 17, 2022

Signed-off-by: Ricardo Noriega rnoriega@redhat.com

Closes #USHIFT-197

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 17, 2022
@oglok
Copy link
Contributor Author

oglok commented Aug 17, 2022

With this PR, local testing showed no error message:

I0718 15:57:18.377000 2180849 server.go:662] "Failed to get the kubelet's cgroup. Kubelet system container metrics may be missing." err="cpu and memory cgroup hierarchy not unified.  cpu: /user.slice, memory: \
/user.slice/user-1000.slice/session-1.scope" 

With these options in the systemd service file, we enable accounting as you can see in the status of the service itself:

systemctl status microshift
● microshift.service - MicroShift
   Loaded: loaded (/usr/lib/systemd/system/microshift.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2022-08-17 11:01:57 EDT; 8min ago
 Main PID: 1821 (microshift)
    Tasks: 25 (limit: 14213)
   Memory: 464.5M
      CPU: 51.887s
   CGroup: /system.slice/microshift.service
           └─1821 /usr/bin/microshift run
[root@localhost ~]# systemctl show microshift | grep -i accounting
CPUAccounting=yes
IOAccounting=no
BlockIOAccounting=yes
MemoryAccounting=yes
TasksAccounting=yes
IPAccounting=no

@oglok
Copy link
Contributor Author

oglok commented Aug 17, 2022

If required, I could add a new target to the Makefile so developers can run MicroShift from systemd in an easier way as @mrunalp suggested.

# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we resetting these 3 specific limits? How do we know we should not bump more to avoid the mentioned performance problems.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, can we add a link in the comment that describes the performance problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I follow @ggiguash , are you talking about the performance issues caused by a very high value in LimitNOFILE? I could reduce it to 1048576 as it seems to be the standard for other project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LimitNOFILE = 1048576 seems to be the standard number for most of the projects that deal with containers from a systemd service.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we update the comment to something more concrete? I think it's important to note what part of the kernel is not performing well.

Having higher limit values cause file system performance problems due to accounting overhead in the kernel. 
We recommend using cgroup to do container-local accounting.

Signed-off-by: Ricardo Noriega <rnoriega@redhat.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2022

@oglok: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ggiguash
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ggiguash, oglok

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

1 similar comment
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 18, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ggiguash, oglok

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

@openshift-merge-robot openshift-merge-robot merged commit ecd5402 into openshift:main Aug 18, 2022
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants