Skip to content
This repository was archived by the owner on Mar 10, 2023. It is now read-only.

Add memory limits to functions #622

Merged

Conversation

martindekov
Copy link
Contributor

@martindekov martindekov commented Mar 21, 2020

Adding memory limits to functions all except
the dashboard are set to limits.memory 128Mi
requests.memory 64Mi the dashboard's limits
are doubled. All functions have requests.cpu
limit of 50m

Signed-off-by: Martin Dekov [email protected]

Description

Closes #614

How Has This Been Tested?

Tested to verify limits are applied by faas deploy -f stack.yml in base folder and in dashboard:

$ kubectl describe deploy system-github-event -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy audit-event -n openfaas-fn
... 
   Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy buildshiprun -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy echo -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy function-logs -n openfaas-fn
... 
   Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy garbage-collect -n openfaas-fn
... 
   Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy git-tar -n openfaas-fn
... 
   Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy github-push -n openfaas-fn
...  
  Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy github-status -n openfaas-fn
... 
   Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy import-secrets -n openfaas-fn
... 
   Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy list-functions -n openfaas-fn
... 
   Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy metrics -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy pipeline-log -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy system-dashboard -n openfaas-fn
...
    Limits:
      memory:  256Mi
    Requests:
      cpu:      50m
      memory:   64Mi
...
$ kubectl describe deploy system-github-event -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...

For gitlab ones:

$ kubectl describe deploy gitlab-push -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
...
$ kubectl describe deploy gitlab-status -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi
$ kubectl describe deploy system-gitlab-event -n openfaas-fn
...
    Limits:
      memory:  128Mi
    Requests:
      cpu:      50m
      memory:   32Mi

How are existing users impacted? What migration steps/scripts do we need?

They will have default memory limits when install the cloud

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • read the CONTRIBUTION guide
  • signed-off my commits with git commit -s
  • added unit tests

@Waterdrips Waterdrips mentioned this pull request Apr 18, 2020
5 tasks
@alexellis alexellis requested a review from Waterdrips April 22, 2020 16:33
@alexellis
Copy link
Member

How Has This Been Tested?

TODO

Copy link
Contributor

@Waterdrips Waterdrips left a comment

Choose a reason for hiding this comment

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

Code looks ok, just the TODO on testing in PR comment

@alexellis
Copy link
Member

I can't merge this without it having been tested.

@martindekov the deployment should work relatively quickly via https://blog.alexellis.io/openfaas-cloud-for-development/

@Waterdrips if you have some spare time and can help, maybe we can get this closed out?

Adding memory limits to functions all except
the dashboard are set to limits.memory 128Mi
requests.memory 64Mi the dashboard's limits
are doubled. All functions have requests.cpu
limit of 50m

Signed-off-by: Martin Dekov <[email protected]>
@martindekov martindekov force-pushed the mdekov/introduce_limits_to_functions branch from b410e98 to aaf6a37 Compare May 17, 2020 20:04
@martindekov
Copy link
Contributor Author

Changed the description with the testing steps. This is ready to be merged

Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

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

Approved

@alexellis alexellis merged commit 70ea949 into openfaas:master Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal] Add resource limits to Platform functions
3 participants