Skip to content

Respect GRANIAN_WORKERS env var in production#5419

Closed
tartansandal wants to merge 1 commit into
reflex-dev:mainfrom
tartansandal:kjh/use-granian-workers-env-var
Closed

Respect GRANIAN_WORKERS env var in production#5419
tartansandal wants to merge 1 commit into
reflex-dev:mainfrom
tartansandal:kjh/use-granian-workers-env-var

Conversation

@tartansandal
Copy link
Copy Markdown
Contributor

Ensures that GRANIAN_WORKERS environment variable is not overridden by --workers parameter when starting the production server.

While testing docker containers on my laptop, I was surprised that I was getting 41 workers when I had set GRANIAN_WORKERS=1. Had to use the deprecated GUNICORN_WORKERS env var to work around this.

I'm not sure if the fix is in the right place, with the config and setup code in flux with the move to granian and 0.8.0, but it does solve the immediate problem.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Fixes production server worker configuration to respect the GRANIAN_WORKERS environment variable, preventing it from being overridden by the automatic worker calculation.

  • Modified reflex/utils/exec.py to only apply calculated worker count when GRANIAN_WORKERS is not set
  • Resolves issue where Docker containers would ignore user-specified worker counts
  • Particularly relevant for development environments where lower worker counts may be desired

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 7, 2025

CodSpeed Performance Report

Merging #5419 will not alter performance

Comparing tartansandal:kjh/use-granian-workers-env-var (b522cf0) with main (c23ffce)

Summary

✅ 8 untouched benchmarks

@Lendemor
Copy link
Copy Markdown
Contributor

Lendemor commented Jun 7, 2025

We've started merging the PRs for 0.8, so we will soon make one that remove the deprecated config props like gunicorn_workers.

So I don't know if we'll take that PR, but we'll make sure that problem is solved in 0.8.

@adhami3310
Copy link
Copy Markdown
Member

superseded by #5422

@adhami3310 adhami3310 closed this Jun 12, 2025
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.

3 participants