Skip to content

DFBUGS-11158: [release-4.22] fix nginx worker_processes OOM on high-CPU nodes - #841

Merged
openshift-merge-bot[bot] merged 1 commit into
red-hat-storage:release-4.22from
NIKHITHAVADDEMPUDI:bug11158
Nov 19, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
red-hat-storage:release-4.22from
NIKHITHAVADDEMPUDI:bug11158

Conversation

@NIKHITHAVADDEMPUDI

@NIKHITHAVADDEMPUDI NIKHITHAVADDEMPUDI commented Nov 17, 2026 •

Copy link
Copy Markdown

https://redhat.atlassian.net/browse/DFBUGS-11158

Backport of #779 to release-4.22.

Problem: ocs-client-operator-console is OOMKilled on high-CPU nodes because nginx uses worker_processes auto and spawns roughly one worker per CPU.

Changes:

  • Converted nginx_root.conf to nginx_root.tmpl and render worker_processes at runtime.
  • GetNginxRootConf() reads CONSOLE_NGINX_WORKER_PROCESSES via GetNginxWorkerProcesses().
  • If the env is unset/invalid → use 8; if set to a positive integer or auto → use that value.
  • The generated nginx config now contains worker_processes ; instead of worker_processes auto;.
  • That config is written into the ocs-client-operator-console nginx ConfigMap by the reconciler.
  • The console pod mounts the ConfigMap, so nginx starts with a fixed small worker count (default 8).
  • The env is not added to the CSV. The controller defaults to 8 when it is not set.
  • To change it at runtime, set CONSOLE_NGINX_WORKER_PROCESSES on the operator Subscription (spec.config.env). Manual ConfigMap edits are overwritten on the next reconcile.
  • Added unit tests for default (8), env override, and invalid fallback behavior.

Difference from main (#779):

  • On main, nginx_root.tmpl and console_test.go already existed (TLS-aware GenerateNginxRootConf), so fix nginx worker_processes OOM on high-CPU nodes #779 only added WorkerProcesses to the template data and updated tests.
  • On release-4.22, nginx config was still a static nginx_root.conf with worker_processes auto and no console_test.go, so this backport renames/converts it to a template, teaches GetNginxRootConf() to render WorkerProcesses, and adds the test file.
  • release-4.22 path has no TLS template fields; the worker_processes behavior matches main.

Comment on lines +518 to +522
LAST_HASH=$(md5sum /etc/nginx/nginx.conf 2>/dev/null)
echo "Nginx is up. Monitoring config changes."

while true; do
CURRENT_HASH=$(md5sum /opt/app-root/etc/nginx.d/*.conf 2>/dev/null | sort | md5sum)
CURRENT_HASH=$(md5sum /etc/nginx/nginx.conf 2>/dev/null)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why these changes ???

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I included these changes in the latest commit

Comment on lines +568 to +571
- mountPath: /etc/nginx/nginx.conf
name: ocs-client-operator-console-nginx-conf
readOnly: true
subPath: nginx.conf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

plz revert these back...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I included these changes in the latest commit

Comment thread config/console/console_init.yaml Outdated
Comment on lines 30 to 82
@@ -76,7 +76,8 @@ spec:
mountPath: /var/serving-cert
readOnly: true
- name: ocs-client-operator-console-nginx-conf
mountPath: /opt/app-root/etc/nginx.d
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
- name: ocs-client-operator-console-s3-endpoint-ca-certs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

plz revert these changes...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I included these changes in the latest commit

done

LAST_HASH=$(md5sum /opt/app-root/etc/nginx.d/*.conf 2>/dev/null | sort | md5sum)
LAST_HASH=$(md5sum /etc/nginx/nginx.conf 2>/dev/null)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we are using * on purpose...
/etc/nginx/nginx.conf is wrong...

plz revert unrelated/unnecessary changes...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I included these changes in the latest commit

Comment thread config/console/console_init.yaml Outdated
readOnly: true
- name: ocs-client-operator-console-nginx-conf
mountPath: /opt/app-root/etc/nginx.d
mountPath: /etc/nginx/nginx.conf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is introducing regression for no reason... these changes aren't even related to the bug...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I included these changes in the latest commit

@SanjalKatiyar

Copy link
Copy Markdown
Contributor

/hold
plz revert the unrelated changes...

@NIKHITHAVADDEMPUDI

Copy link
Copy Markdown
Author

DFBUGS-11158: [release-4.22] fix nginx worker_processes OOM on high-CPU nodes

@NIKHITHAVADDEMPUDI

Copy link
Copy Markdown
Author

/retitle DFBUGS-11158: [release-4.22] fix nginx worker_processes OOM on high-CPU nodes

@openshift-ci openshift-ci Bot changed the title fix nginx worker_processes OOM on high-CPU nodes DFBUGS-11158: [release-4.22] fix nginx worker_processes OOM on high-CPU nodes Nov 18, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid jira ticket of any type jira/valid-bug Indicates that the referenced jira bug is valid for the branch this PR is targeting labels Nov 18, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@NIKHITHAVADDEMPUDI: This pull request references Jira Issue DFBUGS-11158, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (odf-4.22.9) matches configured target version for branch (odf-4.22.9)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @nehaberry

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

https://redhat.atlassian.net/browse/DFBUGS-11158

Backport of #779 to release-4.22.

Problem: ocs-client-operator-console is OOMKilled on high-CPU nodes because nginx uses worker_processes auto and spawns roughly one worker per CPU.

Changes:

  • Converted nginx_root.conf to nginx_root.tmpl and render worker_processes at runtime.
  • GetNginxRootConf() reads CONSOLE_NGINX_WORKER_PROCESSES via GetNginxWorkerProcesses().
  • If the env is unset/invalid → use 8; if set to a positive integer or auto → use that value.
  • The generated nginx config now contains worker_processes ; instead of worker_processes auto;.
  • That config is written into the ocs-client-operator-console nginx ConfigMap by the reconciler.
  • The console pod mounts the ConfigMap, so nginx starts with a fixed small worker count (default 8).
  • The env is not added to the CSV. The controller defaults to 8 when it is not set.
  • To change it at runtime, set CONSOLE_NGINX_WORKER_PROCESSES on the operator Subscription (spec.config.env). Manual ConfigMap edits are overwritten on the next reconcile.
  • Added unit tests for default (8), env override, and invalid fallback behavior.

Difference from main (#779):

  • On main, nginx_root.tmpl and console_test.go already existed (TLS-aware GenerateNginxRootConf), so fix nginx worker_processes OOM on high-CPU nodes #779 only added WorkerProcesses to the template data and updated tests.
  • On release-4.22, nginx config was still a static nginx_root.conf with worker_processes auto and no console_test.go, so this backport renames/converts it to a template, teaches GetNginxRootConf() to render WorkerProcesses, and adds the test file.
  • release-4.22 path has no TLS template fields; the worker_processes behavior matches main.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Nov 18, 2026

Copy link
Copy Markdown

@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: nehaberry.

Note that only red-hat-storage members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

@NIKHITHAVADDEMPUDI: This pull request references Jira Issue DFBUGS-11158, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (odf-4.22.9) matches configured target version for branch (odf-4.22.9)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @nehaberry

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

https://redhat.atlassian.net/browse/DFBUGS-11158

Backport of #779 to release-4.22.

Problem: ocs-client-operator-console is OOMKilled on high-CPU nodes because nginx uses worker_processes auto and spawns roughly one worker per CPU.

Changes:

  • Converted nginx_root.conf to nginx_root.tmpl and render worker_processes at runtime.
  • GetNginxRootConf() reads CONSOLE_NGINX_WORKER_PROCESSES via GetNginxWorkerProcesses().
  • If the env is unset/invalid → use 8; if set to a positive integer or auto → use that value.
  • The generated nginx config now contains worker_processes ; instead of worker_processes auto;.
  • That config is written into the ocs-client-operator-console nginx ConfigMap by the reconciler.
  • The console pod mounts the ConfigMap, so nginx starts with a fixed small worker count (default 8).
  • The env is not added to the CSV. The controller defaults to 8 when it is not set.
  • To change it at runtime, set CONSOLE_NGINX_WORKER_PROCESSES on the operator Subscription (spec.config.env). Manual ConfigMap edits are overwritten on the next reconcile.
  • Added unit tests for default (8), env override, and invalid fallback behavior.

Difference from main (#779):

  • On main, nginx_root.tmpl and console_test.go already existed (TLS-aware GenerateNginxRootConf), so fix nginx worker_processes OOM on high-CPU nodes #779 only added WorkerProcesses to the template data and updated tests.
  • On release-4.22, nginx config was still a static nginx_root.conf with worker_processes auto and no console_test.go, so this backport renames/converts it to a template, teaches GetNginxRootConf() to render WorkerProcesses, and adds the test file.
  • release-4.22 path has no TLS template fields; the worker_processes behavior matches main.

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 openshift-eng/jira-lifecycle-plugin repository.

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-sigs/prow repository.

Comment thread pkg/console/console.go Outdated
Comment on lines +47 to +50
//go:embed nginx_root.tmpl
var nginxRootTmplText string

var nginxRootTmpl = template.Must(template.New("nginxRoot").Parse(nginxRootTmplText))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not inside "GetNginxRootConf" when really needed ??

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I included this change in the latest commit , removed the package-level template.Must parse. The root template is now parsed inside GetNginxRootConf() when the config is generated, same as GetNginxProxyConf.

Default nginx worker_processes to 8; allow override via
CONSOLE_NGINX_WORKER_PROCESSES.

Signed-off-by: VADDEMPUDI NIKHITHA <VADDEMPUDI.NIKHITHA1@ibm.com>
@NIKHITHAVADDEMPUDI

NIKHITHAVADDEMPUDI commented Nov 19, 2026 •

Copy link
Copy Markdown
Author

@NIKHITHAVADDEMPUDI

Copy link
Copy Markdown
Author

@iamniting could you please review this PR, this needs to be merged in z-stream asap

@bipuladh

Copy link
Copy Markdown
Contributor

/lgtm

@leelavg leelavg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/unhold

@openshift-ci

openshift-ci Bot commented Nov 19, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bipuladh, leelavg, NIKHITHAVADDEMPUDI

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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-bot
openshift-merge-bot Bot merged commit 97b0bfd into red-hat-storage:release-4.22 Nov 19, 2026
8 checks passed
@openshift-ci-robot

openshift-ci-robot commented Nov 19, 2026 •

Copy link
Copy Markdown

@NIKHITHAVADDEMPUDI: [Jira Issue DFBUGS-11158](https://redhat.atlassian.net/browse/DFBUGS-11158): All pull requests linked via external trackers have merged:

[Jira Issue DFBUGS-11158](https://redhat.atlassian.net/browse/DFBUGS-11158) has been moved to the MODIFIED state.

Details

In response to this:

https://redhat.atlassian.net/browse/DFBUGS-11158

Backport of #779 to release-4.22.

Problem: ocs-client-operator-console is OOMKilled on high-CPU nodes because nginx uses worker_processes auto and spawns roughly one worker per CPU.

Changes:

  • Converted nginx_root.conf to nginx_root.tmpl and render worker_processes at runtime.
  • GetNginxRootConf() reads CONSOLE_NGINX_WORKER_PROCESSES via GetNginxWorkerProcesses().
  • If the env is unset/invalid → use 8; if set to a positive integer or auto → use that value.
  • The generated nginx config now contains worker_processes ; instead of worker_processes auto;.
  • That config is written into the ocs-client-operator-console nginx ConfigMap by the reconciler.
  • The console pod mounts the ConfigMap, so nginx starts with a fixed small worker count (default 8).
  • The env is not added to the CSV. The controller defaults to 8 when it is not set.
  • To change it at runtime, set CONSOLE_NGINX_WORKER_PROCESSES on the operator Subscription (spec.config.env). Manual ConfigMap edits are overwritten on the next reconcile.
  • Added unit tests for default (8), env override, and invalid fallback behavior.

Difference from main (#779):

  • On main, nginx_root.tmpl and console_test.go already existed (TLS-aware GenerateNginxRootConf), so fix nginx worker_processes OOM on high-CPU nodes #779 only added WorkerProcesses to the template data and updated tests.
  • On release-4.22, nginx config was still a static nginx_root.conf with worker_processes auto and no console_test.go, so this backport renames/converts it to a template, teaches GetNginxRootConf() to render WorkerProcesses, and adds the test file.
  • release-4.22 path has no TLS template fields; the worker_processes behavior matches main.

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 openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that the referenced jira bug is valid for the branch this PR is targeting jira/valid-reference Indicates that this PR references a valid jira ticket of any type lgtm size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants