So we’ve been having an issue where file uploads are super slow and I found out why. Apparently the files are uploaded via many small sequential POST requests. For example a 100KiB file (dd’d from /dev/zero) takes four requests to upload! And a 6.05mb jpeg took about 160 requets to upload!! And each request takes around 300ms before the next one will be sent, causing the upload to take a stupidly long time. See this gif: https://owyf.qonq.gq/
Why in the hell does it do this??! It’s incredibly inefficient and causes file uploads to be super slow, especially for those with high latency (my ping to the server is about 170ms as it’s on the other side of the planet).
Is there a way to increase the size of the chunks? It seems to upload in chunks of about 25KB, which is really small; increasing this would speed up uploads dramatically.
Server Setup Information
- Version of Rocket.Chat Server: 1.3.2
- Operating System: Debian 9 container on Ubuntu 18.04 host
- Deployment Method: manual installation using systemd
- Number of Running Instances: 1
- DB Replicaset Oplog: wat
- NodeJS Version: 8.16.1
- MongoDB Version: 4.2.0
- Proxy: nginx, cloudflare
- Firewalls involved: none
Any additional Information
using default gridfs file store; i also tried FileSystem store but it uploaded at a similar speed, although i didn’t look at networking log until after reverting that.