reflex
reflex copied to clipboard
Configurable Number of Gunicorn Workers
Describe the bug
Number of workers are right now determined based on CPU count if redis is enabled.
This might not always be desired for instance if reflex runs as part of a k8s deployment and os.cpu_count() returns the number of cores on the node, not the pod.
To Reproduce Steps to reproduce the behavior: https://github.com/reflex-dev/reflex/blob/656914edefa7658c76e3d350abe7e9223db313bb/reflex/utils/processes.py#L31-L48
Expected behavior Being able to specify the number of workers through an env var.
Screenshots If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
- Python Version:
- Reflex Version: 0.5.0
- OS:
- Browser (Optional):
Additional context Add any other context about the problem here.