def run_uvicorn_backend_prod(host: str, port: int, loglevel: LogLevel):
    """Run the backend in production mode using Uvicorn.

    Args:
        host: The app host
        port: The app port
        loglevel: The log level.
    """
    from reflex.utils import processes

    config = get_config()

    app_module = get_app_instance()

    command = (
        [
            "uvicorn",
            *(
                (
                    "--limit-max-requests",
                    str(max_requessts),
                )
                if (
                    (max_requessts := _get_backend_max_requests()) is not None
                    and max_requessts > 0
                )
                else ()
            ),
            *(
                ("--timeout-keep-alive", str(timeout))
                if (timeout := _get_backend_timeout()) is not None
                else ()
            ),
            *("--host", host),
            *("--port", str(port)),
            *("--workers", str(_get_backend_workers())),
            "--factory",
            app_module,
        ]
        if constants.IS_WINDOWS
        else [
            "gunicorn",
            *("--worker-class", config.gunicorn_worker_class),
            *(
                (
                    "--max-requests",
                    str(max_requessts),
                )
                if (
                    (max_requessts := _get_backend_max_requests()) is not None
                    and max_requessts > 0
                )
                else ()
            ),
            *(
                (
                    "--max-requests-jitter",
                    str(max_requessts_jitter),
                )
                if (
                    (max_requessts_jitter := _get_backend_max_requests_jitter())
                    is not None
                    and max_requessts_jitter > 0
                )
                else ()
            ),
            "--preload",
            *(
                ("--timeout", str(timeout))
                if (timeout := _get_backend_timeout()) is not None
                else ()
            ),
            *("--bind", f"{host}:{port}"),
            *("--threads", str(_get_backend_workers())),
            f"{app_module}()",
        ]
    )

    command += [
        *("--log-level", loglevel.value),
    ]

    processes.new_process(
        command,
        run=True,
        show_logs=True,
        env={
            environment.REFLEX_SKIP_COMPILE.name: "true"
        },  # skip compile for prod backend
    )
Run the backend in production mode using Uvicorn.

    Args:
        host: The app host
        port: The app port
        loglevel: The log level.
    
reflex/utils/exec.py