Relative github issue: https://github.com/nextcloud/docker/issues/908
My running environments:
Physical OS: Windows server 2019 Datecenter (v1809, 17763.805)
Docker: Docker for windows 2.1.0.4 (Engine: 19.03.4, Compose: 1.24.1, Hyper-V with 4 vCPUs and 4G vRAM)
MySQL: MySQL for winx64 8.0.18 Community Server
Nginx: Nginx for windows 1.16.1
Nextcloud: 17.0.0 (nextcloud:latest)
Additional Containersďź
Onlyoffice-document-serverďź https://hub.docker.com/r/onlyoffice/documentserver, tag:latest
redisďź https://hub.docker.com/_/redis, tag:latest
My docker-compose yml:
version: '3'
networks:
nextcloud:
services:
redis:
image: redis
container_name: redis
hostname: redis
restart: always
networks:
- nextcloud
expose:
- 6379
nextcloud:
image: wyxls/nextcloud:full
container_name: nextcloud
restart: always
depends_on:
- redis
environment:
- NEXTCLOUD_TABLE_PREFIX=oc_
volumes:
- C:/Docker/nextcloud:/var/www/html
- D:/Docker/nextcloud/data:/var/www/html/data
ports:
- 10000:80
networks:
- nextcloud
onlyoffice:
container_name: onlyoffice
image: onlyoffice/documentserver:latest
stdin_open: true
tty: true
restart: always
depends_on:
- nextcloud
volumes:
- C:/Docker/onlyoffice/document_data:/var/www/onlyoffice/Data
- C:/Docker/onlyoffice/document_log:/var/log/onlyoffice
- C:/Docker/onlyoffice/document_fonts:/usr/share/fonts/truetype/custom
- C:/Docker/onlyoffice/document_forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten
ports:
- 10005:443
networks:
- nextcloud
My nginx.conf and nextcloud.conf:
#user nobody;
worker_processes auto;
error_log logs/error.log;
pid logs/nginx.pid;
events {
multi_accept on;
worker_connections 1024;
}
http {
include mime.types;
#include naxsi_core.rules;
default_type application/octet-stream;
access_log off;
charset utf-8;
#aio threads;
#directio 1000m;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
types_hash_max_size 2048;
keepalive_timeout 65s;
keepalive_requests 100;
client_body_timeout 60s;
client_header_timeout 60s;
send_timeout 60s;
reset_timedout_connection on;
client_header_buffer_size 4k;
large_client_header_buffers 4 16k;
client_max_body_size 32m;
client_body_buffer_size 32m ;
open_file_cache max=100000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
fastcgi_connect_timeout 600s;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
gzip on;
gzip_vary on;
gzip_min_length 1k;
gzip_buffers 8 32k;
gzip_comp_level 4;
gzip_types text/plain text/css text/xml text/x-component application/json application/javascript application/rss+xml application/xhtml+xml application/atom+xml image/svg+xml image/x-ms-bmp image/x-icon;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
include C:/nginx/appconf/*.conf;
}
server {
listen 10002 ssl;
server_name example localhost 127.0.0.1;
root C:/Docker/nextcloud;
index index.php;
ssl_certificate C:/SSL-Certificates/cer.cer;
ssl_certificate_key C:/SSL-Certificates/key.key;
ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
proxy_hide_header Strict-Transport-Security;
proxy_hide_header X-Content-Type-Options;
proxy_hide_header X-Robots-Tag;
proxy_hide_header X-Frame-Options;
proxy_hide_header X-Download-Options;
proxy_hide_header X-Permitted-Cross-Domain-Policies;
proxy_hide_header Referrer-Policy;
proxy_hide_header X-XSS-Protection;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header X-Content-Type-Options nosniff;
add_header X-Robots-Tag "none";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Download-Options "noopen";
add_header X-Permitted-Cross-Domain-Policies "none";
add_header Referrer-Policy "no-referrer";
add_header X-XSS-Protection "1; mode=block";
client_max_body_size 10G;
fastcgi_buffers 64 4K;
fastcgi_hide_header X-Powered-By;
location / {
proxy_pass http://127.0.0.1:10000/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffer_size 64k;
proxy_buffers 8 64k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
location = /.well-known/carddav {
return 301 $scheme://$http_host/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$http_host/remote.php/dav;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
deny all;
}
location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
}
My MySQL my.ini
[mysqld]
port=3306
basedir=C:\mysql-winx64
datadir=C:\mysql-winx64\Data
max_connect_errors=10
character-set-server=utf8mb4
collation-server = utf8mb4_general_ci
default-storage-engine=INNODB
default_authentication_plugin=mysql_native_password
key_buffer_size = 128M
max_allowed_packet = 32M
bulk_insert_buffer_size = 32M
thread_stack = 256K
thread_cache_size = 16
table_open_cache = 1024
innodb_buffer_pool_size = 512M
innodb_log_buffer_size = 32M
[mysql]
default-character-set=utf8
[client]
port=3306
I run Nextcloud windows client to synchronize large mount of small file (like xlsx, docs, png, jpg, etc). After I added sync folder in client , the client was noticing âcheck for external changesâ. The progress became stuck every several folders while the client was noticing "check for external changes âfolder nameâ ".
Similar things happen while I uploading big file to Nextcloud in web. Uploding at maximum speed 20+MB/s and slowing down to zero every several seconds.
If it stuck for a long time >60s, sync and upload will fail.
In Nginxâs error.log, it shows :
upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: x.x.x.x, server: example.com, request: "PROPFIND /remote.php/dav/files/wyxls/filename.xlsx HTTP/1.1", upstream: " http://127.0.0.1:10000/remote.php/dav/files/wyxls/filename.xlsx", host: "example.com:10002"
Nextcloud sync client shows:
Error transferring https://example.com:10002/remote.php/dav/files/filename.xlsx - server replied: 504 Gateway time-out
At the same time, Nextcloudâs web seems to be frozen and cannot be access. Itâs like the Nextcloud backend server doesnât respond to Nginx nor clientâs HTTP requests.
I have enlarged lots of variables:
MySQL's buffer things
Nginx's proxy buffer things
Nextcloud's memory limit
.....etc
Thereâs no relative error in nextcloud.log nor relative error in âdocker logs -f nextcloudâ while those âgateway time outâ problems happening.
It seems like some parts of the Nextcloud Container reach bottleneck and never release until I restart the Hyper-V Docker VM.
I run âdocker statsâ to see if the hardware resource is totally being drained but CPU and Memory are only being consumed about 20%
Nothing work though. The most weird thing is that everything else works well including redis and onlyoffice-document-server.
Now Iâm going nuts and donât know what I can do to solve this problem.
Anyone helps?