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

[ws-daemon] Add support for limiting number of processes in workspaces #11448

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

aledbf
Copy link
Member

@aledbf aledbf commented Jul 18, 2022

Description

Allow setting a limit to the number of processes inside a workspace. By default, we have none.

How to test

  • Edit ws-daemon configmap and set "procLimit": 512
  • Start a workspace
  • Open a terminal and run while true; do sleep 1 && date & done
  • Check you sporadically see bash: fork: retry: Resource temporarily unavailable

**

Release Notes

Add support for limiting number of processes in workspaces

Werft options:

  • /werft with-preview

Note: testing this requires cgroups v2

@aledbf
Copy link
Member Author

aledbf commented Jul 18, 2022

/werft run with-preview

👍 started the job as gitpod-build-aledbf-proc.1
(with .werft/ from main)

@aledbf aledbf changed the title [ws-daemon] Add support for limiting the number of processes in a wor… [ws-daemon] Add support for limiting number of processes in workspaces Jul 18, 2022
@aledbf
Copy link
Member Author

aledbf commented Jul 18, 2022

Screenshot from 2022-07-18 11-34-34

@aledbf aledbf marked this pull request as ready for review July 18, 2022 15:34
@aledbf aledbf requested review from a team July 18, 2022 15:34
@github-actions github-actions bot added team: delivery Issue belongs to the self-hosted team team: workspace Issue belongs to the Workspace team labels Jul 18, 2022
@Furisto
Copy link
Member

Furisto commented Jul 18, 2022

Shouldn't the limit update when I update the configmap? The value stays the same, even after Kubernetes has replaced the configmap in the container filesystem.

@aledbf
Copy link
Member Author

aledbf commented Jul 18, 2022

@Furisto please check you are using the latest build. I commit the fix for that not long ago.

(also, keep in mind the update could take > 30s)

Edit: if this does not work, we need to check the code that detects the changes in ws-daemon - not related to this PR)

@Furisto
Copy link
Member

Furisto commented Jul 18, 2022

With the new build, the update behaves as expected.

Copy link
Contributor

@adrienthebo adrienthebo left a comment

Choose a reason for hiding this comment

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

LGTM, as @aledbf noted via Slack the preview environments don't yet use cgroups v2 so I can't directly verify but it looks sound to me.

@roboquat roboquat merged commit 8130107 into main Jul 18, 2022
@roboquat roboquat deleted the aledbf/proc branch July 18, 2022 21:25
@roboquat roboquat added the deployed: workspace Workspace team change is running in production label Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: workspace Workspace team change is running in production release-note size/L team: delivery Issue belongs to the self-hosted team team: workspace Issue belongs to the Workspace team
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants