add FPM worker tuning and architecture diagram

Increase PHP-FPM max_children from 5 to 12 to handle concurrent
requests without queuing, sized for a ~3GB VPS. Add Mermaid
architecture diagram to README.
This commit is contained in:
2026-03-22 17:07:43 +01:00
parent 4329cfd3f2
commit 995dfcc099
3 changed files with 50 additions and 0 deletions

View File

@@ -2,6 +2,48 @@
Docker Compose setup for a self-hosted VPS running Nextcloud, Gitea, and monitoring — managed as a GitOps-style repo. Docker Compose setup for a self-hosted VPS running Nextcloud, Gitea, and monitoring — managed as a GitOps-style repo.
## Architecture
```mermaid
graph TB
Internet([Internet])
subgraph VPS["VPS (t-gstone.de)"]
subgraph proxy_net["proxy network"]
Caddy["Caddy<br/>reverse proxy + auto HTTPS"]
end
subgraph nc_stack["Nextcloud Stack"]
Nginx["Nginx<br/>static files + FastCGI proxy"]
NC["Nextcloud FPM<br/>PHP processing"]
Cron["Cron<br/>background jobs"]
PG["PostgreSQL 17"]
Redis["Redis 8"]
end
subgraph gitea_stack["Gitea Stack"]
Gitea["Gitea<br/>rootless, SQLite"]
end
subgraph mon_stack["Monitoring Stack"]
Alloy["Grafana Alloy"]
end
end
GrafanaCloud([Grafana Cloud])
Internet -->|":443 HTTPS"| Caddy
Internet -->|":2222 SSH"| Gitea
Caddy -->|"nextcloud.t-gstone.de"| Nginx
Caddy -->|"git.t-gstone.de"| Gitea
Nginx -->|":9000 FastCGI"| NC
NC --> PG
NC --> Redis
Cron --> PG
Cron --> Redis
Alloy -->|"logs + metrics"| GrafanaCloud
```
## Prerequisites ## Prerequisites
- A VPS with SSH access - A VPS with SSH access

View File

@@ -19,6 +19,7 @@ services:
- ${DATA_ROOT}/nextcloud/data:/var/www/html/data - ${DATA_ROOT}/nextcloud/data:/var/www/html/data
- ./hooks/post-installation.sh:/docker-entrypoint-hooks.d/post-installation/post-installation.sh:ro - ./hooks/post-installation.sh:/docker-entrypoint-hooks.d/post-installation/post-installation.sh:ro
- ./hooks/post-upgrade.sh:/docker-entrypoint-hooks.d/post-upgrade/post-upgrade.sh:ro - ./hooks/post-upgrade.sh:/docker-entrypoint-hooks.d/post-upgrade/post-upgrade.sh:ro
- ./fpm-tuning.conf:/usr/local/etc/php-fpm.d/zz-tuning.conf:ro
networks: networks:
- nextcloud-internal - nextcloud-internal
logging: logging:

View File

@@ -0,0 +1,7 @@
[www]
pm = dynamic
pm.max_children = 12
pm.start_servers = 4
pm.min_spare_servers = 2
pm.max_spare_servers = 6
pm.max_requests = 500