Skip to content

adding keepalives to upstream connection #28

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Rider-Linden
Copy link
Contributor

No description provided.

@Rider-Linden Rider-Linden requested a review from Copilot June 30, 2025 22:34
Copilot

This comment was marked as outdated.

@Rider-Linden Rider-Linden requested a review from Copilot July 2, 2025 20:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a file-descriptor limit to the Nginx worker process and documents it, defaulting the new limit to twice the worker connections setting.

  • Add worker_rlimit_nofile directive to nginx.conf.template.
  • Compute and export WORKER_FILE_LIMIT in the Docker entrypoint script.
  • Document the new WORKER_FILE_LIMIT variable in README.md.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
src/etc/nginx/nginx.conf.template Introduce worker_rlimit_nofile {{ .Env.WORKER_FILE_LIMIT }}
src/docker-entrypoint.d/00-render-templates.sh Export and default WORKER_FILE_LIMIT=$(( WORKER_CONNECTIONS * 2 ))
README.md Add WORKER_FILE_LIMIT entry and default in environment variable
Dockerfile Adjusted whitespace around ENV block
Comments suppressed due to low confidence (4)

src/docker-entrypoint.d/00-render-templates.sh:19

  • Add a test or integration check to verify that WORKER_FILE_LIMIT is correctly calculated and applied when rendering the Nginx config.
export WORKER_FILE_LIMIT=${WORKER_FILE_LIMIT:=$(( WORKER_CONNECTIONS * 2 ))}

src/docker-entrypoint.d/00-render-templates.sh:19

  • [nitpick] It may be safer to validate that WORKER_CONNECTIONS is set and is a positive integer before performing arithmetic expansion, to avoid unexpected defaults.
export WORKER_FILE_LIMIT=${WORKER_FILE_LIMIT:=$(( WORKER_CONNECTIONS * 2 ))}

src/etc/nginx/nginx.conf.template:10

  • [nitpick] Align the indentation of worker_rlimit_nofile with other top-level directives for consistent readability.
worker_rlimit_nofile {{ .Env.WORKER_FILE_LIMIT }};

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant