Optimize server performance by utilizing multiple workers
Currently, the Chainlit server initialization is configured to use only a single worker, as seen in the chainlit/cli/init.py. This setup does not take full advantage of the available CPU resources, particularly in a production environment.
To improve the server's performance and efficiency, it is proposed to configure the server to launch with multiple workers. This change aims to better utilize the underlying hardware's CPU capabilities, potentially enhancing the application's ability to handle concurrent requests and workloads.
Implementation Reference For guidance on implementing this enhancement, the Uvicorn deployment documentation provides valuable information on how to run Uvicorn with Gunicorn, using multiple worker processes.
Expected Outcome By addressing this issue, we anticipate a more scalable and responsive server that can maintain performance under higher loads. This optimization is particularly crucial for production deployments where maximizing resource utilization is essential.
uvicorn.Config has 'workers' parameter, how about exposure in chainlit?
Yep, support this idea! Currently, Chainlit freezes while operating/loading some big LLM. And that causes further bugs with Messages sanding
This will be needed for scaling up. Any plans?
same question +1
This issue is stale because it has been open for 14 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.