Capacity and several copies
Capacidad y varias copias
What is known about giving the installation more room: the fixed limits of the application, and what to take into account before running more than one copy of it.
Qué se sabe sobre darle más lugar a la instalación: los límites fijos de la aplicación, y qué tener en cuenta antes de correr más de una copia.
Limits that come with the application
Límites que trae la aplicación
| Limit | Value | What happens at the limit |
|---|---|---|
| Connections to the database, per copy of the application | Up to 60 | A request that waits more than 15 seconds for a free connection fails with a timeout. |
| Size of one uploaded file | 50 MB | The upload is refused. |
| Size of the body of a request that is not a file | 8 MB | The request is refused. It can be changed with SPRING_CODEC_MAX_IN_MEMORY_SIZE, in bytes. |
| Wait for a PDF document | 60 seconds | The document fails. It can be changed with PDF_GOTENBERG_TIMEOUT. |
| Límite | Valor | Qué pasa al llegar |
|---|---|---|
| Conexiones a la base de datos, por cada copia de la aplicación | Hasta 60 | Un pedido que espera más de 15 segundos por una conexión libre falla por tiempo agotado. |
| Tamaño de un archivo subido | 50 MB | La subida se rechaza. |
| Tamaño del cuerpo de un pedido que no es un archivo | 8 MB | El pedido se rechaza. Se cambia con SPRING_CODEC_MAX_IN_MEMORY_SIZE, en bytes. |
| Espera por un documento en PDF | 60 segundos | El documento falla. Se cambia con PDF_GOTENBERG_TIMEOUT. |
Give the application more memory
Darle más memoria a la aplicación
The Compose files set no memory limit. The memory of Java is controlled with JAVA_OPTS in the environment block of backend, for example -Xmx4g. The delivery does not state a recommended figure: watch the use of the container under your real load and adjust.
Los archivos Compose no fijan un límite de memoria. La memoria de Java se controla con JAVA_OPTS en el bloque environment de backend, por ejemplo -Xmx4g. La entrega no dice una cifra recomendada: mirá el uso del contenedor con tu carga real y ajustá.
Running more than one copy
Correr más de una copia
The Compose files start one copy of the application. The delivery shows an example for Kubernetes with two copies of each image, but it does not document how to operate it. If you do it, take this into account:
Los archivos Compose levantan una sola copia de la aplicación. La entrega muestra un ejemplo para Kubernetes con dos copias de cada imagen, pero no documenta cómo operarlo. Si lo hacés, tené en cuenta:
- Every copy needs exactly the same settings and the same secret keys, the same database, the same cache and the same file store.
- Each copy opens up to 60 connections. Two copies already exceed the limit of 100 that PostgreSQL has unless you raise it.
- Each copy keeps for up to a minute what it knows about the modules of each organisation, so a change may take that long to be seen everywhere.
- When the copies start together after an upgrade, one applies the migrations and the others wait for it.
- Try it in a test installation before relying on it.
- Todas las copias necesitan exactamente los mismos ajustes y las mismas claves secretas, la misma base, la misma caché y el mismo almacén de archivos.
- Cada copia abre hasta 60 conexiones. Dos copias ya pasan el límite de 100 que tiene PostgreSQL si no lo subís.
- Cada copia conserva hasta un minuto lo que sabe de los módulos de cada organización, así que un cambio puede tardar eso en verse en todos lados.
- Cuando las copias arrancan juntas después de una actualización, una aplica las migraciones y las demás la esperan.
- Probalo en una instalación de prueba antes de confiar en él.
Common issues
Problemas habituales
- "FATAL: sorry, too many clients already" in the log
- The database reached its connection limit. Raise max_connections in PostgreSQL, or run fewer copies of the application.
- Lists load slowly or come empty at busy times
- Requests are waiting for a free database connection. Check the load of the database first; it is usually the database that is slow, not the limit that is low.
- An upload fails for large files only
- The file exceeds 50 MB, or your reverse proxy has a lower limit.
- «FATAL: sorry, too many clients already» en el registro
- La base llegó a su límite de conexiones. Subí max_connections en PostgreSQL, o corré menos copias de la aplicación.
- Las listas cargan lento o vienen vacías en horas de mucho uso
- Hay pedidos esperando una conexión libre a la base. Revisá primero la carga de la base; por lo general es la base la que está lenta, no el límite el que es bajo.
- Una subida falla solo con archivos grandes
- El archivo pasa de 50 MB, o tu proxy inverso tiene un límite más bajo.