OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add additional scaling info (#18259)
Oliver Günther9d32d53fd552
diff --git a/docs/installation-and-operations/operation/control/README.md b/docs/installation-and-operations/operation/control/README.mdindex 69c5bab5fd2..a2ad56b4d85 100644--- a/docs/installation-and-operations/operation/control/README.md+++ b/docs/installation-and-operations/operation/control/README.md@@ -48,45 +48,7 @@ sudo openproject run ruby -v# if using docker-compose: docker-compose run --rm web ruby -v```-### Scaling the number of web workers-Note: Depending on your free RAM on your system, we recommend you raise the default number of web processes. The default from 9.0.3 onwards is 4 web processes. Each worker will take roughly 300-400MB RAM.--We recommend at least 4 web processes. Please check your current web processes count with:--```shell-sudo openproject config:get OPENPROJECT_WEB_WORKERS-```--If it returns nothing, the default process count of `4` applies. To increase or decrease the process count, call--```shell-sudo openproject config:set OPENPROJECT_WEB_WORKERS=number-```--Where `number` is a positive number between 1 and `round(AVAILABLE_RAM * 1.5)`.--After changing these values, simply restart the web process:--```shell-sudo openproject restart web-```--### Scaling the number of background workers--Note: Depending on your free RAM on your system, we recommend you raise the default number of background processes. By default, one background worker is spawned. Background workers are responsible for delivering mails, copying projects, performing backups and deleting resources.--We recommend to have two background worker processes. Please check your current web processes count with:--To set the desired process count, call--```shell-sudo openproject scale worker=number-```--Where `number` is a positive number between 1 and `round(AVAILABLE_RAM * 1.5)`.--The respective systemd services are automatically created or removed. If you were already at the entered value, it will output `Nothing to do.`## All-in-one Docker-based installationdiff --git a/docs/installation-and-operations/operation/scaling/README.md b/docs/installation-and-operations/operation/scaling/README.mdnew file mode 100644index 00000000000..d37cdfd2e82--- /dev/null+++ b/docs/installation-and-operations/operation/scaling/README.md@@ -0,0 +1,113 @@+---+sidebar_navigation:+ title: Scaling+ priority: 5++---++# Scaling your OpenProject installation++The following environment variables are relevant for performance.++- `OPENPROJECT_WEB_WORKERS`: Number of web workers handling HTTP requests. Note that in Kubernetes deployments, this value is applied using replicas of the services.+- `OPENPROJECT_WEB_TIMEOUT`: Maximum request processing time in seconds.+- `OPENPROJECT_WEB_WAIT__TIMEOUT`: Timeout for waiting requests in seconds.+- `OPENPROJECT_WEB_MIN__THREADS`: Minimum number of threads per web worker.+- `OPENPROJECT_WEB_MAX__THREADS`: Maximum number of threads per web worker.+- `OPENPROJECT_GOOD__JOB__MAX_THREADS`: Maximum number of threads for background workers.++## Packaged installation++Note: Depending on your free RAM on your system, we recommend you raise the default number of web processes. The default from 9.0.3 onwards is 4 web processes. Each worker will take roughly 300-400MB RAM.++We recommend at least 4 web processes. Please check your current web processes count with:++```shell+sudo openproject config:get OPENPROJECT_WEB_WORKERS+```++If it returns nothing, the default process count of `4` applies. To increase or decrease the process count, call++```shell+sudo openproject config:set OPENPROJECT_WEB_WORKERS=number+```++Where `number` is a positive number between 1 and `round(AVAILABLE_RAM * 1.5)`.++After changing these values, simply restart the web process:++```shell+sudo openproject restart web+```++### Scaling the number of background workers++Note: Depending on your free RAM on your system, we recommend you raise the default number of background processes. By default, one background worker is spawned. Background workers are responsible for delivering mails, copying projects, performing backups and deleting resources.++We recommend to have two background worker processes. Please check your current web processes count with:++To set the desired process count, call++```shell+sudo openproject scale worker=number+```++Where `number` is a positive number between 1 and `round(AVAILABLE_RAM * 1.5)`.++The respective systemd services are automatically created or removed. If you were already at the entered value, it will output `Nothing to do.`++## All-in-one Docker-based installation++There is no way to scale the all-in-one docker installation. We recommend to use a docker compose or Kubernetes deployment to provide full flexibility in scaling your installation.++## docker-compose based installation++To scale your docker compose installation, update your `.env` and upgrade the worker definitions from above. For example:++```shell+OPENPROJECT_WEB_WORKERS=number+```++Where `number` is a positive number between 1 and `round(AVAILABLE_RAM * 1.5)`.++> [!NOTE]+>+> Docker compose is not horizontally scalable on multiple instances without additional tools++## Kubernetes and Helm-Charts++To scale your OpenProject Helm chart / kubernetes deployment, you need to adjust the values in your values.yaml file, specifically:++- **Increase replicaCount**: This controls the number of OpenProject web instances.+- **Increase backgroundReplicaCount**: This controls the number of background worker instances.+- **Adjust worker replicas**: In the workers section, increase replicas for different types of workers.+- **Ensure adequate resource allocation**: Scale up CPU and memory limits accordingly.++For example:++```yaml+ # Web deployment containers replicas+replicaCount: 2++# Web deployment resources+resources:+ requests:+ memory: "512Mi"+ cpu: "250m"+ limits:+ memory: "4Gi"+ cpu: "4"++# Worker deployment+workers:+ default:+ replicas: 1 # Keep 1 worker+ resources:+ requests:+ memory: "512Mi"+ cpu: "250m"+ limits:+ memory: "4Gi"+ cpu: "4"+```+diff --git a/docs/installation-and-operations/system-requirements/README.md b/docs/installation-and-operations/system-requirements/README.mdindex c402cb102db..8d359eb9715 100644--- a/docs/installation-and-operations/system-requirements/README.md+++ b/docs/installation-and-operations/system-requirements/README.md@@ -22,7 +22,7 @@ The server hardware requirements should be roughly the same for both the packageThis is for a single server running OpenProject for up to 200 total users. Depending on your number of concurrent users, these requirements might vary drastically.-### General Requirements+## Scaling RequirementsGenerally speaking you will need more CPUs (the faster the better) and more RAM with an increasing number of users.Technically this only really depends on the number of concurrent users. No matter if you have 1000 or only 100 total users, if there only ever 20 users working at the same time, the CPU & RAM required will be the same.@@ -35,33 +35,123 @@ If there are more users you will need more web workers and eventually also moreThe database will need resources as well, and this, too, will increase with the number of users.There may come a point where you will have to make configuration changes to the database and/or use an external database, but for most cases the default database setup should be enough. You will ideally want to have the database on a performant storage such as SSDs. [There are also other excellent resources](https://wiki.postgresql.org/wiki/Performance_Optimization) for tuning PostgreSQL database performance.-Using a rough estimate we can give the following recommendations based on the number of total users.+Using a rough estimate we can give the following recommendations based on the number of total active users.-| Users | CPU cores | RAM in GB | web workers | background workers | disk space in GB |-|-------|-----------|------------|-------------|--------------------|------------------|-| <=200 | 4 | 4 | 4 | 1 | 20 |-| 500 | 8 | 8 | 8 | 2 | 40 |-| 1500 | 16 | 16 | 16 | 4 | 80 |+| Total active users | CPU cores | RAM in GB | web workers | background workers | disk space in GB |+| ------------------ | --------- | --------- | ----------- | ------------------ | ---------------- |+| <=200 | 4 | 4 | 2 | 1 | 20 |+| 500 | 8 | 8 | 4 | 2 | 40 |+| 1500 | 16 | 16 | 8 | 4 | 80 |-Mind, even just for 5 users we do recommend the default 4 workers as each page may require-multiple requests to be made simultaneously. Having less workers will work, but pages may take longer to finish loading.+Mind, even just for 5 users we do recommend 2 web workers as each page may require+multiple requests to be made simultaneously. Having just one will work, but pages may take longer to finish loading.-These numbers are a guideline only and your mileage may vary.<sup>1</sup>+These numbers are a guideline only and your mileage may vary.It's best to monitor your server and its resource usage. You can always allocate more resources if needed.-See [here](../operation/control/#scaling-the-number-of-web-workers) how to scale those up in a packaged installation. If you are using docker-compose you can [scale](https://docs.docker.com/compose/reference/scale/) the web and worker services too.+### **Scaling horizontally**-> <sup>1</sup> When using [docker-compose](https://github.com/opf/openproject-deploy/tree/stable/15/compose) (with `USE_PUMA=true`) you can use fewer web workers which may use a bit more RAM, however. For instance for 200 users a single web worker would be enough.+At some point simply increasing the resources of one single server may not be enough anymore.-**Scaling horizontally**+OpenProject needs to scale in three different dimensions:-At some point simply increasing the resources of one single server may not be enough anymore.+- Sizing of CPU & RAM, Storage, and Availability (e.g., available number of connections) in the PostgreSQL database+- Number of web application workers and their multithreading parameters for request queues and parallel request execution+- Number of background workers and their multithreading parameters for sending out emails, creating exports, or performing bulk operations (copying work packages, projects, etc.)In the _packaged installation_ you can have multiple servers running OpenProject. They will need to share an external database, memcached and file storage (e.g. via NFS), however.-One way to scale the _docker_ installation is to use [docker Swarm](../installation/docker/#docker-swarm).+> [!NOTE]+>+> We recommend to run OpenProject in a [Kubernetes deployment using our Helm charts](../installation/helm-chart), or in smaller environments, [docker compose](../installation/docker-compose) or [docker Swarm](../installation/docker/#docker-swarm). Kubernetes and Docker swarm are fully horizontally scalable++[For more information on applying scaling options depending on your installation method, please see this document](../operation/scaling/).+++### Scaling parameters++Extrapolating the general system requirements for different sets of users, you will roughly need these scaling parameters. These information correlate with our SaaS infrastructure, so we assume current or last-generation CPUs and architecture. Assume higher values accordingly for older generations.++- **Database**: 2 CPU / 8 GiB RAM per ~500 Users+- **CPU**: 4-6 CPU per ~500 users+- **RAM**: 6-8 GiB per ~500 users+- **Web Workers**: +4 per ~500 users+- **Background Workers**: +1-2 multithreaded workers per ~500 users, depending on workload+- **Disk Space**: +20-50 GiB per ~500 users, depending on workload and attachment storage++These values are **guidelines** and should be adjusted based on actual monitoring of resource usage. Scaling should prioritize **CPU and RAM, prioritize scaling Web Workers** first, followed by **Background Workers and Disk Space** as needed.++## Example Configurations++### **Small Instance (≤ 200 users, low concurrent activity)**++- **Database**: 2 CPU / 4 GiB RAM++- **CPU**: 2 CPU++- **RAM**: 4 GB++- **Web Workers**: 2 Workers, each with 4 threads++- **Background Workers**: 1 multithreaded worker with 4GiB RAM (more RAM possibly required for larger exports)++- **Disk Space**: 20 GB + additional disk space in case of internal attachment storage++### **Medium Instance (~500 users, moderate concurrent activity)**++- **Database**: 2-4 CPU / 8 GiB RAM+- **CPU**: 4 CPU+- **RAM**: 8 GB+- **Web Workers**: 4 Workers, each with 4-8 threads+ •+- **Background Workers**: 2 multithreaded workers with 4-6 GiB RAM+- **Disk Space**: 50 GB + additional disk space in case of internal attachment storage++### **Large Instance (~1500 users, medium to high concurrent activity)**++- **Database**: 4-8 CPU / 16 GiB RAM+- **CPU**: 8 CPU+- **RAM**: 16-24 GB+- **Web Workers**: 6-8 Workers, each with 8-32 threads+- **Background Workers**: 4-8 multithreaded workers with 4-6GiB RAM, depending on workload+- **Disk Space**: 100 GB + additional disk space in case of internal attachment storage++### **Enterprise-scale multitenancy instance (~80K - 100K users, high concurrent activity)**++- **Database**: Cluster of two 8 vCPU / 32 GiB RAM (e.g., AWS db.m7g.xlarge, Gravitron 3)+- **Worker instances**: 2-4 instances of the following+ - **CPU**: 8 CPU (e.g., AWS r7a.xlarge instances)+ - **RAM**: 32GB++- **Web Workers**: 8 - 12 Workers, each with 8-32 threads and 6GiB available RAM+- **Background Workers**: 8 multithreaded workers with 4-6GiB RAM, depending on workload+- **Disk Space**: 250 GB + additional disk space in case of internal attachment storage++++### Additional Scaling Recommendations++**Monitor Resource Usage**++You can [use our health checks to monitor the background job queue](../operation/monitoring/#health-checks). If the `worker_backed_up` check fails you may want to scale up the number of background workers.++For everything else a general monitoring solution for your servers is recommended.+Be it cloud-platform solutions like CloudWatch (AWS), or your own setup using open-source tools+such as Prometheus and Grafana.++Adjust CPU, RAM, and disk space as needed.++**Database Scaling**++Consider external PostgreSQL with performance tuning.++**Load Balancing**++For high-availability setups, distribute traffic across multiple servers and availability regions.++-### Operating system+## Host Operating systemThe [package-based installation](../installation/packaged) requires one of the following Linux distributions: