Compare commits

...

7 Commits

Author SHA1 Message Date
BeauTroll
fc1cac8e5a fix: properly configure Apache MPM Prefork with dedicated config file
- Create dedicated apache/mpm_prefork.conf to override default MPM settings
- Mount mpm_prefork.conf to /etc/apache2/mods-available/ to properly apply limits
- Remove MPM config from nextcloud.conf (was being ignored)
- Set ServerLimit and MaxRequestWorkers to 400 (up from 150 default)
- Configure optimized worker settings for better concurrency

This fixes the "server reached MaxRequestWorkers" error that was causing
sync failures and 404 errors by properly overriding Apache's default
configuration file instead of trying to set it in conf-enabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 04:14:41 +01:00
BeauTroll
5d610b9177 increase server limit 2026-01-03 04:07:31 +01:00
BeauTroll
8096d8985b Merge remote-tracking branch 'origin/main' 2026-01-03 04:03:16 +01:00
BeauTroll
8462b10e3b fix: increase Apache MaxRequestWorkers and optimize performance settings
- Increase MaxRequestWorkers from 150 to 400 to prevent "server reached MaxRequestWorkers" errors
- Configure MPM Prefork module with optimized worker settings
- Add AllowEncodedSlashes NoDecode for special characters in filenames
- Increase Redis maxmemory from 512MB to 2GB for better caching
- Extend PHP execution times from 1800s to 7200s for large operations
- Increase MariaDB max_allowed_packet to 1GB for large file uploads

These changes resolve sync failures caused by Apache worker exhaustion.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 04:00:12 +01:00
root
6bdd8e918c add traefik transport 2025-12-23 01:28:12 +01:00
root
44ec0a004a remove uncessary labels 2025-12-23 01:04:16 +01:00
root
c403419ea1 adapt for traefik labels 2025-12-23 00:23:18 +01:00
5 changed files with 66 additions and 7 deletions

View File

@@ -162,6 +162,24 @@ docker compose exec -u www-data nextcloud php occ preview:generate-all nom_utili
**Note:** L'image est buildée localement et taguée `nextcloud-custom:latest`. Lors des mises à jour Nextcloud, pensez à rebuild l'image.
# Server Transport Traefik
Ajouter à traefik.yml :
```yml
serversTransport:
nextcloud-transport:
forwardingTimeouts:
dialTimeout: 30s
responseHeaderTimeout: 0s
idleConnTimeout: 3600s
```
OU au docker-compose.yml
```yml
command:
- "--serverstransport.forwardingtimeouts.dialtimeout=30s"
- "--serverstransport.forwardingtimeouts.responseheadertimeout=0"
- "--serverstransport.forwardingtimeouts.idleconntimeout=3600s"
```
### Configuration Apache pour Traefik
Le fichier `apache/nextcloud.conf` configure Apache pour fonctionner correctement derrière le reverse proxy Traefik.

16
apache/mpm_prefork.conf Normal file
View File

@@ -0,0 +1,16 @@
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxRequestWorkers (must be set before MaxRequestWorkers)
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
ServerLimit 400
StartServers 10
MinSpareServers 10
MaxSpareServers 20
MaxRequestWorkers 400
MaxConnectionsPerChild 1000
</IfModule>

View File

@@ -1,5 +1,10 @@
# Configuration pour reverse proxy Traefik
# Récupération de l'IP réelle du client via X-Forwarded-For
ServerName cloud.agence66.fr
# Autoriser les caractères spéciaux encodés dans les noms de fichiers
AllowEncodedSlashes NoDecode
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 172.16.0.0/12
RemoteIPTrustedProxy 10.0.0.0/8

View File

@@ -13,3 +13,6 @@ binlog_format = ROW
# Connections
max_connections = 200
# Gros fichiers - augmenter la taille max des paquets
max_allowed_packet = 1G

View File

@@ -8,6 +8,7 @@ services:
volumes:
- ./data:/var/www/html
- ./apache/nextcloud.conf:/etc/apache2/conf-enabled/nextcloud.conf:ro
- ./apache/mpm_prefork.conf:/etc/apache2/mods-available/mpm_prefork.conf:ro
- ./logs/apache:/var/log/apache2
logging:
driver: "json-file"
@@ -32,16 +33,16 @@ services:
- REDIS_HOST_PASSWORD=${REDIS_HOST_PASSWORD}
# PHP
- PHP_MEMORY_LIMIT=4096M
- PHP_UPLOAD_MAX_FILESIZE=2G
- PHP_POST_MAX_SIZE=2G
- PHP_MAX_EXECUTION_TIME=1800
- PHP_MAX_INPUT_TIME=1800
- PHP_UPLOAD_MAX_FILESIZE=10G
- PHP_POST_MAX_SIZE=10G
- PHP_MAX_EXECUTION_TIME=7200
- PHP_MAX_INPUT_TIME=7200
# - PHP_UPLOAD_MAX_FILESIZE=1024G
# - PHP_POST_MAX_SIZE=1024G
# - PHP_MAX_EXECUTION_TIME=86400
# - PHP_MAX_INPUT_TIME=86400
# Apache
- APACHE_BODY_LIMIT=2147483648
- APACHE_BODY_LIMIT=0
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/status.php"]
interval: 30s
@@ -55,11 +56,27 @@ services:
networks:
- nextcloud-net
- traefik-net
labels:
- "traefik.enable=true"
# Router configuration
- "traefik.http.routers.cloud.rule=Host(`${NEXTCLOUD_DOMAIN}`)"
- "traefik.http.routers.cloud.entrypoints=websecure"
- "traefik.http.routers.cloud.tls.certresolver=letsencrypt"
- "traefik.http.routers.cloud.middlewares=nextcloud-headers,nextcloud-redirect"
# Service configuration
- "traefik.http.services.cloud.loadbalancer.server.port=80"
- "traefik.http.services.cloud.loadbalancer.serverstransport=nextcloud-transport"
# Middleware: Headers
- "traefik.http.middlewares.nextcloud-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.middlewares.nextcloud-headers.headers.customresponseheaders.Strict-Transport-Security=max-age=15552000"
# Middleware: Redirect pour CalDAV/CardDAV
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.regex=https://(.*)/.well-known/(card|cal)dav"
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.replacement=https://$$1/remote.php/dav/"
- "traefik.http.middlewares.nextcloud-redirect.redirectregex.permanent=true"
redis:
image: redis:alpine
restart: unless-stopped
command: redis-server --requirepass ${REDIS_HOST_PASSWORD} --maxmemory 512mb --maxmemory-policy allkeys-lru
command: redis-server --requirepass ${REDIS_HOST_PASSWORD} --maxmemory 2gb --maxmemory-policy allkeys-lru
networks:
- nextcloud-net