|
| 1 | +--- |
| 2 | +sidebar_navigation: |
| 3 | + title: Scaling |
| 4 | + priority: 5 |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +# Scaling your OpenProject installation |
| 9 | + |
| 10 | +The following environment variables are relevant for performance. |
| 11 | + |
| 12 | +- `OPENPROJECT_WEB_WORKERS`: Number of web workers handling HTTP requests. Note that in Kubernetes deployments, this value is applied using replicas of the services. |
| 13 | +- `OPENPROJECT_WEB_TIMEOUT`: Maximum request processing time in seconds. |
| 14 | +- `OPENPROJECT_WEB_WAIT__TIMEOUT`: Timeout for waiting requests in seconds. |
| 15 | +- `OPENPROJECT_WEB_MIN__THREADS`: Minimum number of threads per web worker. |
| 16 | +- `OPENPROJECT_WEB_MAX__THREADS`: Maximum number of threads per web worker. |
| 17 | +- `OPENPROJECT_GOOD__JOB__MAX_THREADS`: Maximum number of threads for background workers. |
| 18 | + |
| 19 | +## Packaged installation |
| 20 | + |
| 21 | +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. |
| 22 | + |
| 23 | +We recommend at least 4 web processes. Please check your current web processes count with: |
| 24 | + |
| 25 | +```shell |
| 26 | +sudo openproject config:get OPENPROJECT_WEB_WORKERS |
| 27 | +``` |
| 28 | + |
| 29 | +If it returns nothing, the default process count of `4` applies. To increase or decrease the process count, call |
| 30 | + |
| 31 | +```shell |
| 32 | +sudo openproject config:set OPENPROJECT_WEB_WORKERS=number |
| 33 | +``` |
| 34 | + |
| 35 | +Where `number` is a positive number between 1 and `round(AVAILABLE_RAM * 1.5)`. |
| 36 | + |
| 37 | +After changing these values, simply restart the web process: |
| 38 | + |
| 39 | +```shell |
| 40 | +sudo openproject restart web |
| 41 | +``` |
| 42 | + |
| 43 | +### Scaling the number of background workers |
| 44 | + |
| 45 | +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. |
| 46 | + |
| 47 | +We recommend to have two background worker processes. Please check your current web processes count with: |
| 48 | + |
| 49 | +To set the desired process count, call |
| 50 | + |
| 51 | +```shell |
| 52 | +sudo openproject scale worker=number |
| 53 | +``` |
| 54 | + |
| 55 | +Where `number` is a positive number between 1 and `round(AVAILABLE_RAM * 1.5)`. |
| 56 | + |
| 57 | +The respective systemd services are automatically created or removed. If you were already at the entered value, it will output `Nothing to do.` |
| 58 | + |
| 59 | +## All-in-one Docker-based installation |
| 60 | + |
| 61 | +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. |
| 62 | + |
| 63 | +## docker-compose based installation |
| 64 | + |
| 65 | +To scale your docker compose installation, update your `.env` and upgrade the worker definitions from above. For example: |
| 66 | + |
| 67 | +```shell |
| 68 | +OPENPROJECT_WEB_WORKERS=number |
| 69 | +``` |
| 70 | + |
| 71 | +Where `number` is a positive number between 1 and `round(AVAILABLE_RAM * 1.5)`. |
| 72 | + |
| 73 | +> [!NOTE] |
| 74 | +> |
| 75 | +> Docker compose is not horizontally scalable on multiple instances without additional tools |
| 76 | +
|
| 77 | +## Kubernetes and Helm-Charts |
| 78 | + |
| 79 | +To scale your OpenProject Helm chart / kubernetes deployment, you need to adjust the values in your values.yaml file, specifically: |
| 80 | + |
| 81 | +- **Increase replicaCount**: This controls the number of OpenProject web instances. |
| 82 | +- **Increase backgroundReplicaCount**: This controls the number of background worker instances. |
| 83 | +- **Adjust worker replicas**: In the workers section, increase replicas for different types of workers. |
| 84 | +- **Ensure adequate resource allocation**: Scale up CPU and memory limits accordingly. |
| 85 | + |
| 86 | +For example: |
| 87 | + |
| 88 | +```yaml |
| 89 | + # Web deployment containers replicas |
| 90 | +replicaCount: 2 |
| 91 | + |
| 92 | +# Web deployment resources |
| 93 | +resources: |
| 94 | + requests: |
| 95 | + memory: "512Mi" |
| 96 | + cpu: "250m" |
| 97 | + limits: |
| 98 | + memory: "4Gi" |
| 99 | + cpu: "4" |
| 100 | + |
| 101 | +# Worker deployment |
| 102 | +workers: |
| 103 | + default: |
| 104 | + replicas: 1 # Keep 1 worker |
| 105 | + resources: |
| 106 | + requests: |
| 107 | + memory: "512Mi" |
| 108 | + cpu: "250m" |
| 109 | + limits: |
| 110 | + memory: "4Gi" |
| 111 | + cpu: "4" |
| 112 | +``` |
| 113 | +
|
0 commit comments