# Timeout when uploading large file from client to server

**URL:** <https://help.nextcloud.com/t/timeout-when-uploading-large-file-from-client-to-server/10305>\
**Category:** 💻 Desktop\
**Created:** [March 17, 2017, 4:08pm UTC](https://help.nextcloud.com/t/timeout-when-uploading-large-file-from-client-to-server/10305 "2017-03-17T16:08:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wiesel](https://help.nextcloud.com/letter_avatar/wiesel/32/5_5575768a8748004e209b776fc1b2916d.png) [@wiesel](https://help.nextcloud.com/u/wiesel)\
**Post date:** [March 17, 2017, 4:08pm UTC](https://help.nextcloud.com/t/timeout-when-uploading-large-file-from-client-to-server/10305/1 "2017-03-17T16:08:58Z")

</div>

Hello everyone,

maybe I’ve found a bug in the NC Desktop client for Windows. My NC instance is set up to sync large files and works perfect if I upload the file used below through the web interface. Synchronization with the desktop client doesn’t work:

1. File (22GB) is added to NC directory.
2. The file is transferred to the server completely.
3. Progress stops at “0s remaining”, server side CPU load drops to ~20% and harddisk I/O raises.
4. Instead of waiting for the server to finish processing the file, the client throws a timeout error after a few minutes.
5. After about 20mins the file appears properly on the server and other clients can download it. The failing client has to be restartet and recognizes the file as synced.
6. There are no errors in the server logs (Apache and NC).

A few details about my configuration:

- Nextcloud 11.0.2 hostet within a virtual machine on a XenServer 7: 4GB RAM and 4 CPU-Cores for the VM, physical CPU is a Celeron J1900.
- Debian Jessie, set up today with Apache 2.4.10, PHP 7 and MariaDB 10.0.30.
- Self signed SSL-certificates
- Client 2.2.4 on Windows 8.1 and Windows 10, both have this problem.
- PHP timeout parameters set to 2h like mentioned in the documentation, no other restricting parameters were found in my Apache- and SSL-config
- Maximum file size in PHP and NC set to 200GB
- Clients and server connected with gigabit ethernet

This is reproduceable. What I can see is that the server is doing fine as the file appears ok after the server has processed it for about 20mins. Now I can restart the client and it recognizes the file correctly as synced. Other clients download the file as well. I don’t know what the server does after the upload, but I guess that it merges the splitted file and/or calculates a checksum because there is a heavy disk I/O on the server. The timeout detection at the client side should take account of this to support large files on slow servers like mine.

Additionally, the transfer with the client takes four times longer than with the web interface, but that is ok for me. Does anybody have a hint for me how to fix the timeouts or is it actually a bug? Is the client-side timeout adjustable? Please forgive me if this is caused by a faulty configuration 🙂

Arne

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [March 18, 2017, 7:22pm UTC](https://help.nextcloud.com/t/timeout-when-uploading-large-file-from-client-to-server/10305/2 "2017-03-18T19:22:04Z")

</div>

Looks like the client doesn’t wait long enough. But copying should be faster than 20 min on a local disk (for 20 minutes, the transfer rate is less than 19 MB/s).

For the upload via client: Files are normally split up in chunks of 5 MB and chunks can be uploaded parallel. This increases the upload speed on normal internet connections, for gigabit networks the chunksize is too small. You can manually set a environment variable to increase it:  
[https://doc.owncloud.org/desktop/2.3/advancedusage.html#configuration-file](https://doc.owncloud.org/desktop/2.3/advancedusage.html#configuration-file)

---

<div class="post-metadata">

**Author:** ![davidhache](https://help.nextcloud.com/letter_avatar/davidhache/32/5_5575768a8748004e209b776fc1b2916d.png) [@davidhache](https://help.nextcloud.com/u/davidhache)\
**Post date:** [March 20, 2017, 8:44pm UTC](https://help.nextcloud.com/t/timeout-when-uploading-large-file-from-client-to-server/10305/3 "2017-03-20T20:44:47Z")

</div>

Hi,  
It’s interesting the issue you have with large files.  
I find myself in the same situation with much smaller files.

I am using:

Nextcloud “version”: “11.0.2.7”,  
PHP 7.0.15-0ubuntu0.16.04.4 (fpm-fcgi)  
nginx version: nginx/1.10.0 (Ubuntu)  
HA-Proxy version 1.6.3 2015/12/25  
mariadb-server-10.1

I have set most of the settings i can find to high values:

config.php  
‘dbdriveroptions’ =\> array(  
PDO::MYSQL\_ATTR\_INIT\_COMMAND =\> ‘SET wait\_timeout = 28800’  
),  
‘dbdriveroptions’ =\>  
array (  
1002 =\> ‘SET wait\_timeout = 28800’,  
),

php.ini  
max\_execution\_time = 3600  
max\_input\_time = -1  
memory\_limit = 512M  
post\_max\_size = 16G  
upload\_tmp\_dir = /nextcloudtmp/  
upload\_max\_filesize = 16G  
max\_file\_uploads = 20

php www.conf  
request\_terminate\_timeout = 3600s

nginx config:  
client\_max\_body\_size 16G;  
fastcgi\_buffers 64 4K;  
gzip off;  
fastcgi\_request\_buffering off;  
location ~^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34]).php(?:$|/) {  
include fastcgi\_params;  
fastcgi\_split\_path\_info ^(.+.php)(/.+)$;  
fastcgi\_param SCRIPT\_FILENAME $document\_root$fastcgi\_script\_name;  
fastcgi\_param PATH\_INFO $fastcgi\_path\_info;  
fastcgi\_param HTTPS on;  
#Avoid sending the security headers twice  
fastcgi\_param modHeadersAvailable true;  
fastcgi\_param front\_controller\_active true;  
fastcgi\_pass unix:/var/run/php/php7.0-fpm.sock;  
fastcgi\_intercept\_errors on;  
fastcgi\_request\_buffering off;  
fastcgi\_read\_timeout 300;  
}

Here are the kinds of errors i am getting:

> “reqId”:“5PP2OU4szySCBQs/Rb4f”,“remoteAddr”:“96.20.23.217”,“app”:“webdav”,“message”:“Exception: {"Message":"HTTP\/1.1 500 An exception occurred while executing ‘SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`,\n\t\t\t\t\t `storage_mtime`, `encrypted`, `etag`, `permissions`, `checksum`\n\t\t\t\tFROM `oc_filecache` WHERE `storage` = ? AND `path_hash` = ?’ with params [30, \"2e45cb7e4749322bfdc16d746dec882f\"]:\n\nSQLSTATE[HY000]: **General error: 2006 MySQL server has gone away","Exception":"Sabre\\DAV\\Exception","Code**":0,"Trace":"#0 \/var\/www\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php(106): OCA\\DAV\\Connector\\Sabre\\File-\>convertToSabreException(Object(Doctrine\\DBAL\\Exception\\DriverException))\n#1 \/var\/www\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php(137): OCA\\DAV\\Connector\\Sabre\\File-\>put(Resource id #17)\n#2 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1072): OCA\\DAV\\Connector\\Sabre\\Directory-\>createFile(‘LibreOffice\_5.2…’, Resource id #17)\n#3 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(525): Sabre\\DAV\\Server-\>createFile(‘Apps\/LibreOffic…’, Resource id #17, NULL)\n#4 [internal function]: Sabre\\DAV\\CorePlugin-\>httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call\_user\_func\_array(Array, Array)\n#6 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter-\>emit(‘method:PUT’, Array)\n#7 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server-\>invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#8 \/var\/www\/nextcloud\/apps\/dav\/appinfo\/v1\/webdav.php(60): Sabre\\DAV\\Server-\>exec()\n#9 \/var\/www\/nextcloud\/remote.php(165): require\_once(‘\/var\/www\/nextcl…’)\n#10 {main}","File":"\/var\/www\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php","Line":557,"User":"524400001"}”,“level”:4,“time”:\*\*“2017-03-20T20:25:57+00:00”,“method”:“PUT”,“url”:“/remote.php/webdav/Apps/LibreOffice\_5.2.4\_Win\_x86.msi-chunking-959466703-11-\*\*4”,“user”:“524400001”,“version”:“11.0.2.7”}

Would someone have inspiration as to where to look?  
Thanks  
D

---

<div class="post-metadata">

**Author:** ![wiesel](https://help.nextcloud.com/letter_avatar/wiesel/32/5_5575768a8748004e209b776fc1b2916d.png) [@wiesel](https://help.nextcloud.com/u/wiesel)\
**Post date:** [March 23, 2017, 8:09am UTC](https://help.nextcloud.com/t/timeout-when-uploading-large-file-from-client-to-server/10305/4 "2017-03-23T08:09:17Z")

</div>

Thank you, I will try this in the next few days.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 4:20pm UTC](https://help.nextcloud.com/t/timeout-when-uploading-large-file-from-client-to-server/10305/5 "2024-12-14T16:20:54Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 14, 2024, 4:20pm UTC](https://help.nextcloud.com/t/timeout-when-uploading-large-file-from-client-to-server/10305/6 "2024-12-14T16:20:55Z")

</div>


