Guide to dynamic worker configuration in the Coreiix system based on deployment environments.
The system architecture in Coreiix regarding Workers relies primarily on the core configuration file (app/config.py and .env) and the startup script (start.py). The number of workers is determined dynamically and intelligently based on the DEPLOYMENT_PROFILE.
The system utilizes the Uvicorn server to run the FastAPI application. Worker management and structure vary depending on the operating environment as follows:
dev Profile)1 (Single worker).reload=True), making it ideal for developers. The server restarts instantly upon any code modification without requiring manual intervention.small Profile)2 (Two workers).enterprise Profile)(CPU Cores × 2) + 1The system provides complete flexibility for system administrators to manually define the number of workers, overriding the default profiles mentioned above, through two methods:
.env file: By directly adding the WORKERS variable.python start.py --workers 4
This architecture ensures that the system is scalable and smoothly accommodates businesses of all sizes.