Timeouts browsing/downloading from external smb storage

Nextcloud version: 18.0.4
Operating system and version: Ubuntu 18.04.4 TLS
Apache or nginx version: 2.4.29
PHP version: 7.2.24
SMB version: 4.7.6

The issue you are facing:
1.Slowness and frequent timeout browsing into external smb storage.
2. Timeout downloading files

Error log :

  1. Icewind\SMB\Exception\AccessDeniedException: Access denied

    /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Connection.php - line 44:

    Icewind\SMB\Wrapped\Parser->checkConnectionError(“tree connec … D”)

OCP\Files\StorageAuthException: Storage unauthorized. Access denied

/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php - line 183:

OCA\Files_External\Lib\Storage\SMB->throwUnavailable(Icewind\SMB\ ... {}0)

2.text Doctrine\DBAL\Exception\LockWaitTimeoutException: An exception occurred while executing ‘INSERT INTO oc_file_locks (key, lock, ttl) VALUES(?, ?, ?)’ with params [“files/a0dbd3cd8c43e6a470b00fb39f4635a9”, 1, 1589381601]: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

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

<?php
$CONFIG = array (
  'instanceid' => 
  'passwordsalt' => 
  'secret' => 
  'trusted_domains' =>
  array (
    0 => 'fs.quality-partner.be',
  ),
  'datadirectory' => '/srv/data/nextcloud/data',
  'overwrite.cli.url' => 'http://192.168.254.',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => 
  'logtimezone' => 'UTC',
  'installed' => true,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpmode' => 'smtp',
  'maintenance' => false,
  'loglevel' => 2,
  'trashbin_retention_obligation' => 'auto,7',
  'updater.release.channel' => 'stable',
  'theme' => '',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'it',
  'mail_domain' => '',
  'mail_smtphost' => '',
  'mail_smtpport' => '25',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mysql.utf8mb4' => true,
  'updater.secret' => 'K',