Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodetect SMB volumes and force use of RAM DB #1419

Open
RhetTbull opened this issue Feb 27, 2024 · 1 comment
Open

Autodetect SMB volumes and force use of RAM DB #1419

RhetTbull opened this issue Feb 27, 2024 · 1 comment
Labels
feature request New feature or request

Comments

@RhetTbull
Copy link
Owner

Using osxphotos over a Synology NAS (and likely other SMB volumes) can be horribly slow due to SQLite performance over these very slow network volumes. Detect if volume is SMB and if so, use --ramdb automatically. Add a --no-ramdb that prevents this if required.

See #1415 and #1418

See this discussion for a way of detecting if volume is SMB.

@RhetTbull RhetTbull added the feature request New feature or request label Feb 27, 2024
@RhetTbull
Copy link
Owner Author

This appears to work on macOS:

def is_smbfs_path(path):
    path_device = os.stat(path).st_dev
    mounts = os.popen("mount").readlines()
    for mount in mounts:
        if "(smbfs" in mount:
            mnt_device = os.stat(mount.split(" ")[2]).st_dev
            if mnt_device == path_device:
                return True
    return False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant