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

Extreme slow rewriting of files on NFS drive #553

Open
crankedguy opened this issue Feb 28, 2022 · 7 comments
Open

Extreme slow rewriting of files on NFS drive #553

crankedguy opened this issue Feb 28, 2022 · 7 comments

Comments

@crankedguy
Copy link

Hello,

I noticed that there are extremely slow speeds when files have to be rewritten. The drive is an NFS mount and a 200MB FLAC needs over 30 seconds to be rewritten. Network transfer speeds are capped at 30MB/s shown during the operation.
Normal speeds are shown around 125/110 read/write
Any idea why this is the case with Mutagen, I have to rewrite several TB and this cannot be done so.

Thanks

@lazka
Copy link
Member

lazka commented Feb 28, 2022

Likely because the rewrite is done in blocks:

def move_bytes(fobj, dest, src, count, BUFFER_SIZE=_DEFAULT_BUFFER_SIZE):

You could try increasing _DEFAULT_BUFFER_SIZE (in the code)

@crankedguy
Copy link
Author

Thanks for your quick response. Any idea how to circumvent this except copying the files to tag to a local disk and back? Which is painful in its own with these sizes

@crankedguy
Copy link
Author

I've seen you just answered this :) Will try it out giving it some more buffer, thanks

@lazka
Copy link
Member

lazka commented Feb 28, 2022

Otherwise you can use the following from https://mutagen.readthedocs.io/en/latest/user/padding.html

def no_new_padding(info):
    # this will use existing padding but never add new one
    return max(info.padding, 0)

f.save(padding=no_new_padding)

This means it will only rewrite the file if absolutely needed. By default it will add more padding the first time to make future changes are faster.

If the files don't have any tags at all, or no padding, or you add cover art, then this wont help though.

@crankedguy
Copy link
Author

Yes this is the case, most of the files have no cover art at all and if, it has to be updated, also they are not padded well enough by the creator. I will never understand why someone doesn't pad a few bytes nowadays when creating a 2-300MB in the first place. But it is how it is

@crankedguy
Copy link
Author

I notched this up to 2**21 until now and it brought tremendous speed improvements. Still slow though in terms to normal speed of the shares.

lazka added a commit to lazka/mutagen that referenced this issue Jul 16, 2022
256KB was chosen as good enough when doing local copies, but in quodlibet#553
it was pointed out that this is quite slow with remote filesystems like
NFS etc.

Bump to 1MB to improve that a bit..
destroid11 pushed a commit to destroid11/mutagen that referenced this issue Jul 19, 2022
256KB was chosen as good enough when doing local copies, but in quodlibet#553
it was pointed out that this is quite slow with remote filesystems like
NFS etc.

Bump to 1MB to improve that a bit..
@phw
Copy link
Collaborator

phw commented Feb 14, 2023

There is also related #587

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

No branches or pull requests

3 participants