[pve-devel] [PATCH] Increase SMB/CIFS file attribute cache time

Fiona Ebner f.ebner at proxmox.com
Fri Aug 19 12:02:44 CEST 2022


Hi,

On 16.08.22 05:16, Matt Corallo wrote:
> For those using SMB for long-distance remote backups, the default
> cache setting of 1 second for file attributes causes the GUI
> "backup" tabs to time-out long before they finishing loading.

I'm not saying increasing the timeout can't be worth it, but I haven't
seen many reports about the default being too low. There is a patch in
the works [0] allowing to set custom options in the storage
configuration for CIFS which would allow changing the timeout only for
setups that actually require it.

[0]: https://lists.proxmox.com/pipermail/pve-devel/2022-July/053645.html

> 
> Because Proxmox isn't likely to be accessing SMB shares with file
> attributes changing at high rates where the changes need to be
> visible immediately, simply bumping the attribute cache time is a
> safe, simple change.
> 
> e.g. for my remote-backup site (~70ms away), loading a backup list
> with only 200 files in the `dump` directory does not work at all
> with the default cache time, with 60 seconds it loads just fine.
> 
> Signed-off-by: Matt Corallo <git at bluematt.me>
> ---
>  PVE/Storage/CIFSPlugin.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/Storage/CIFSPlugin.pm b/PVE/Storage/CIFSPlugin.pm
> index 982040a..dcc53e0 100644
> --- a/PVE/Storage/CIFSPlugin.pm
> +++ b/PVE/Storage/CIFSPlugin.pm
> @@ -69,7 +69,7 @@ sub cifs_mount {
>      $server = "[$server]" if Net::IP::ip_is_ipv6($server);
>      my $source = "//${server}/$share";
> 
> -    my $cmd = ['/bin/mount', '-t', 'cifs', $source, $mountpoint, '-o',
> 'soft', '-o'];
> +    my $cmd = ['/bin/mount', '-t', 'cifs', $source, $mountpoint, '-o',
> 'soft', '-o', 'actimeo=60', '-o'];
> 
>      if (my $cred_file = get_cred_file($storeid)) {
>      push @$cmd, "username=$user", '-o', "credentials=$cred_file";





More information about the pve-devel mailing list