The Basics
- Nextcloud Server version (e.g., 29.x.x):
- 33.0.0
- Operating system and version (e.g., Ubuntu 24.04):
Synology
- Reverse proxy and version _(e.g. nginx 1.27.2)
- Synology reverse proxy
- When did this problem seem to first start?
Since first installation
- Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
Docker containers
- Are you using CloudfIare, mod_security, or similar? (Yes / No)
No
Summary of the issue you are facing:
Hello,
For the longest time, I’ve been bothered by the slow upload speed of my Nextcloud instance. Downloads run nice and fast, but uploads are unacceptably slow. I’ve been trying to figure out the cause of the slow upload speed. Note that I’m talking about local LAN upload/download here, so the network is not the issue.
What I’ve noticed is that whenever I perform an upload, the server thrashes significantly. The disk IO goes up to 100%. The actual file upload over the network is fast as indicated by the client and the network activity monitors, but it takes several seconds for the file to be acknowledged by the server, before the client moves on to the next file. If the file is very large (e.g. several gigabytes), the server will not acknowledge the file in time, and the client will attempt to upload the same file again. Eventually, because the first upload has finished verifying, it will move on.
My current theory is that this happens because I’ve got chunked uploads enabled, but the chunks are stored on disk. So if I upload a large file, the chunks are stored on the disk, and then reassembled from the disk to another location on the disk. Because I’m using magnetic disks in Synology Hybrid RAID (RAID 5), this results in significant
I think the solution is to make it so that the chunks are stored in RAM, perhaps in a tmpfs, so that the server reads it from RAM when reassembling. But I can’t figure out how to do that.
In particular, I am using docker containers for nextcloud. I’ve set them up according to this guide:
I got the following questions
- How can I confirm that my theory is correct, that the chunked data is stored onto disk and then read back again during reassembly?
- How can I fix this problem if I am using docker containers?
Configuration
Nextcloud
{
"system": {
"htaccess.RewriteBase": "\/",
"memcache.local": "\\OC\\Memcache\\APCu",
"apps_paths": [
{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"password": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"overwritehost": ***REMOVED SENSITIVE VALUE***,
"overwriteprotocol": "https",
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***",
"***REMOVED SENSITIVE VALUE***"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "33.0.0.16",
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauth": 1,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "587",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-glibc",
"memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
"maintenance": false,
"loglevel": 1,
"memories.db.triggers.fcu": true,
"theme": "",
"maintenance_window_start": 1,
"files.chunked_upload.max_size": 134217728,
"forbidden_filename_basenames": [
"con",
"prn",
"aux",
"nul",
"com0",
"com1",
"com2",
"com3",
"com4",
"com5",
"com6",
"com7",
"com8",
"com9",
"com\u00b9",
"com\u00b2",
"com\u00b3",
"lpt0",
"lpt1",
"lpt2",
"lpt3",
"lpt4",
"lpt5",
"lpt6",
"lpt7",
"lpt8",
"lpt9",
"lpt\u00b9",
"lpt\u00b2",
"lpt\u00b3"
],
"forbidden_filename_characters": [
"<",
">",
":",
"\"",
"|",
"?",
"*",
"\\",
"\/"
],
"forbidden_filename_extensions": [
" ",
".",
".filepart",
".part"
],
"enable_previews": true,
"enabledPreviewProviders": [
"OC\\Preview\\BMP",
"OC\\Preview\\GIF",
"OC\\Preview\\JPEG",
"OC\\Preview\\Krita",
"OC\\Preview\\MarkDown",
"OC\\Preview\\MP3",
"OC\\Preview\\OpenDocument",
"OC\\Preview\\PNG",
"OC\\Preview\\TXT",
"OC\\Preview\\XBitmap",
"OC\\Preview\\Font",
"OC\\Preview\\HEIC",
"OC\\Preview\\Illustrator",
"OC\\Preview\\Movie",
"OC\\Preview\\MSOffice2003",
"OC\\Preview\\MSOffice2007",
"OC\\Preview\\MSOfficeDoc",
"OC\\Preview\\PDF",
"OC\\Preview\\Photoshop",
"OC\\Preview\\Postscript",
"OC\\Preview\\StarOffice",
"OC\\Preview\\SVG"
]
}
}