-
Notifications
You must be signed in to change notification settings - Fork 426
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
Too much memory used with large number of namespaces #1268
Comments
Thanks for the detailed bug report. At a first glance, it looks like the watch for the lister/informer cache may be watching too many things. |
It prevents controller to watch for configMap in all namespaces. Before this change: controller logs shows: 2021/11/25 08:46:36 Registering 5 informers crictl stats reports 66.88MB with around 4k configMaps of 2.5kB with kind. After this change: controller logs shows: 2021/11/25 08:48:48 Registering 4 informers crictl stats reports 16.29MB Related to tektoncd#1268
I found an explanation for the Triggers controller. See #1273 For the interceptors container: I observe that all secrets of the cluster are kept in memory. See https://github.com/tektoncd/triggers/blob/main/cmd/interceptors/main.go#L67.
Pros:
Cons:
Pros:
Cons:
|
Replace the secret informer by a secret getter. It implies that for each webhook an API call will be issued against the k8s API to get the secret. Previously, all secrets of the cluster were in the interceptor memory. Before this change: crictl stats reports 79.18MB with around 5k secrets of 2.5kB with kind. After this change: crictl stats reports 8.221MB Related to tektoncd#1268
I also realize that the triggers controller is watching for all deployments and all services in the cluster. It might be a good idea to filter them. |
It prevents controller to watch for configMap in all namespaces. Before this change: controller logs shows: 2021/11/25 08:46:36 Registering 5 informers crictl stats reports 66.88MB with around 4k configMaps of 2.5kB with kind. After this change: controller logs shows: 2021/11/25 08:48:48 Registering 4 informers crictl stats reports 16.29MB Related to tektoncd#1268
It prevents controller to watch for configMap in all namespaces. Before this change: controller logs shows: 2021/11/25 08:46:36 Registering 5 informers crictl stats reports 66.88MB with around 4k configMaps of 2.5kB with kind. After this change: controller logs shows: 2021/11/25 08:48:48 Registering 4 informers crictl stats reports 16.29MB Related to tektoncd#1268
It prevents controller to watch for configMap in all namespaces. Before this change: controller logs shows: 2021/11/25 08:46:36 Registering 5 informers crictl stats reports 66.88MB with around 4k configMaps of 2.5kB with kind. After this change: controller logs shows: 2021/11/25 08:48:48 Registering 4 informers crictl stats reports 16.29MB Related to #1268
/priority important-longterm |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
This was mostly fixed. The remaining work is around caching only the secrets needed by the interceptors vs all secrets. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Fixed by #1359 |
Expected Behavior
Same memory usage as the pipeline controller
Actual Behavior
The memory taken by the interceptor and trigger controller is around 1GB.
This is not the case of the pipeline controller which stay around 50MB.
(memory usage of pods in Tekton namespace during the load test - highest are tekton-triggers-controller and tekton-triggers-core-interceptors pods)
Steps to Reproduce the Problem
Additional Info
Kubernetes version:
Output of
kubectl version
:pipeline: v0.28.2
triggers: v0.16.1
It is stable: if I kill the pod, the controller is recreated and takes almost the same amount of memory.
The cluster has 681 deployments and 14180 configMaps.
I turned on profiling and saw there is something happening in the informers.
The text was updated successfully, but these errors were encountered: