Upload files is slow

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 18.0.6
Operating system and version (eg, Ubuntu 20.04): Debian 10.5
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38 (Debian)
PHP version (eg, 7.1): PHP 7.3.19-1~deb10u1

The issue you are facing:
Slow upload of files. I get a upload speed on 977 kb/s to 1,2 MB/s
Thise is on small and big files. 1 mb -> 500 mb.
If i use a speed test I have thise inn/out from the server
Latency: 7.09 ms (0.32 ms jitter)
Download: 68.70 Mbps (data used: 83.2 MB)
Upload: 61.77 Mbps (data used: 54.4 MB)

How can I get some better speeds?

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: filesize(): stat failed for /srv/nextcloud_data/ekb/files/test/DALI-Cockpit_V136_0.zip.ocTransferId232397518.part at /srv/www/nextcloud/lib/private/Files/Storage/Local.php#170

MOVE /remote.php/dav/uploads/ekb/web-file-upload-26ce8b7966d4bdf0deccd4759c8b19b1-1598058697548/.file
from 84.213.107.109 by ekb at 2020-08-22T01:12:16+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '************',
  'passwordsalt' => '************',
  'secret' => '************',
  'blacklisted_files' =>
  array (
    0 => '.htaccess',
    1 => 'Thumbs.db',
    2 => 'thumbs.db',
  ),
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'cloud.******.com',
    2 => '***.com',
    3 => '***.***.***.*',
    4 => '***.***.***.*',
  ),
  'datadirectory' => '/srv/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '18.0.6.0',
  'overwrite.cli.url' => 'https://cloud.*******.***',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '*******',
  'dbpassword' => '*******',
  'installed' => true,
  'default_locale' => 'no_NO.UTF-8',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '127.0.0.1',
    'port' => 6379,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => '*******@gmail.com',
  'mail_smtppassword' => '***********',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => '*****',
  'mail_domain' => 'gmail.com',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.secret' => '***************',
);






The output of your php log in /etc/php/7.3/cli/php.ini:

output_buffering = 4096
post_max_size = 20G
upload_tmp_dir = /var/www/nextcloud/data/upload_tmp
upload_max_filesize = 20G
max_file_uploads = 200
apc.enable_cli=1

ekstra info`:

uname -rv
4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07)

inxi
CPU: Quad Core Intel Xeon E-2124G (-MCP-) speed/min/max: 4176/800/4500 MHz Kernel: 4.19.0-9-amd64 x86_64
Up: 58d 16h 34m Mem: 5355.4/15876.4 MiB (33.7%) Storage: 2.04 TiB (5.5% used) Procs: 260 Shell: bash 5.0.3
inxi: 3.0.32


nmap -p 6379 localhost
Starting Nmap 7.70 ( https://nmap.org ) at 2020-08-22 03:18 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00055s latency).
Other addresses for localhost (not scanned): ::1
PORT     STATE SERVICE
6379/tcp open  redis
Nmap done: 1 IP address (1 host up) scanned in 0.30 seconds

Espen

Are there messages because of optimatiaton in the nextcloud webbased administration panel overview?

103/5000

Sorry, I’m not sure what you mean? When I did the test, only me was connected.

Som more info

apc

APC Compatibility 1.0.4
APCu Version 5.1.17
Build Date Nov 4 2018 04:16:28

apcu

APCu Support Enabled
Version 5.1.17
APCu Debugging Disabled
MMAP Support Enabled
MMAP File Mask no value
Serialization Support php, igbinary
Build Date Feb 8 2019 16:18:59
Directive Local Value Master Value
apc.coredump_unmap Off Off
apc.enable_cli Off Off
apc.enabled On On
apc.entries_hint 4096 4096
apc.gc_ttl 3600 3600
apc.mmap_file_mask no value no value
apc.preload_path no value no value
apc.serializer php php
apc.shm_segments 1 1
apc.shm_size 32M 32M
apc.slam_defense Off Off
apc.smart 0 0
apc.ttl 0 0
apc.use_request_time On On

memcached

memcached support enabled
Version 3.1.3
libmemcached version 1.0.18
SASL support yes
Session support yes
igbinary support yes
json support yes
msgpack support yes
Directive Local Value Master Value
memcached.compression_factor 1.3 1.3
memcached.compression_threshold 2000 2000
memcached.compression_type fastlz fastlz
memcached.default_binary_protocol Off Off
memcached.default_connect_timeout 0 0
memcached.default_consistent_hash Off Off
memcached.serializer php php
memcached.sess_binary_protocol On On
memcached.sess_connect_timeout 0 0
memcached.sess_consistent_hash On On
memcached.sess_consistent_hash_type ketama ketama
memcached.sess_lock_expire 0 0
memcached.sess_lock_max_wait not set not set
memcached.sess_lock_retries 5 5
memcached.sess_lock_wait not set not set
memcached.sess_lock_wait_max 150 150
memcached.sess_lock_wait_min 150 150
memcached.sess_locking On On
memcached.sess_number_of_replicas 0 0
memcached.sess_persistent Off Off
memcached.sess_prefix memc.sess.key. memc.sess.key.
memcached.sess_randomize_replica_read Off Off
memcached.sess_remove_failed_servers Off Off
memcached.sess_sasl_password no value no value
memcached.sess_sasl_username no value no value
memcached.sess_server_failure_limit 0 0
memcached.store_retry_count 2 2

redis

Redis Support enabled
Redis Version 4.2.0
Available serializers php, igbinary
Directive Local Value Master Value
redis.arrays.autorehash 0 0
redis.arrays.connecttimeout 0 0
redis.arrays.distributor no value no value
redis.arrays.functions no value no value
redis.arrays.hosts no value no value
redis.arrays.index 0 0
redis.arrays.lazyconnect 0 0
redis.arrays.names no value no value
redis.arrays.pconnect 0 0
redis.arrays.previous no value no value
redis.arrays.readtimeout 0 0
redis.arrays.retryinterval 0 0
redis.clusters.persistent 0 0
redis.clusters.read_timeout 0 0
redis.clusters.seeds no value no value
redis.clusters.timeout 0 0
redis.session.lock_expire 0 0
redis.session.lock_retries 10 10
redis.session.lock_wait_time 2000 2000
redis.session.locking_enabled 0 0

Read all about Nextcloud Tuning. Please deactivate Redis for testing. Check up-/download with other webservices like one file “tiny file manager”. https://github.com/prasathmani/tinyfilemanager

Hello.

I tride with tinyfilermanager. And the upload speeds are much faster.

I have have looked at diffrent tunning pages I have found when googling around. Followed them and tride. But not found anything that helps the upload speeds. I even upgraded the firewall and the internett speed so I now have 200 Mbps up and down.

Speeds when trying to upload a 1gb file is 470kb to 2 mb. And it takes 15-20 min.

Can you or sombody else copy youre settings on apache, php, radis and nextcloud.

The rest of the nextcloud server is fast. But the readme.md takes some time to load.

I found a solution. I disabeled clamav. The virusscanner. And now I get 20 MB/s in upload speed.