-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Very low Samba performance when primarycache=metadata #1773
Comments
It sounds as is Samba is regularly accessing data which is no longer cached. This could happen for a variety of reasons and it's hard to say exactly why without digging deeper in to what Samba is doing. However, since ZFS will already preferentially cache meta data in favor of file data I think you'll want to leave primarycache=all set regardless. |
@behlendorf with primarycache=metadata ARC should ignore data, could this effectively disable prefetch? |
Yes. I'd only expect the metadata prefetching to work in that case. |
This would explain why samba performance goes south: no prefetch from zfs = every single read gets a fresh roundtrip through the disk... |
I am experiencing the same issue with samba on top of zfs (centos 6 with zol 6.1). The fix for me was to add:
to smb.conf. |
@unicolet Thanks for the hint, although it's not at all clear to me why ZoL would need those tuning when other Linux FSs do not. Any ideas? |
@behlendorf no idea really, but for what it's worth I straced a samba pid while opening a directory (that I had already browsed, so at least in theory it should have been in the cache). This is a list, sorted by the ascending number of calls that occcur during a change directory from windows explorer on an XP client:
Could it be that lstat is slow in ZoL and it stalls network connectivity as samba would in fact lstat a directory and then send a bit of information over the network? The options above reduce the simptoms, but do not cure the issue. |
this ZoL setting improved snappines even more, should be the default:
|
@unicolet It probably will be one dataset level feature flags are implemented. |
It's my understanding that the tuning suggested above have resulted in improved performance. Things should continue to gradually as we incrementally improve performance. Therefore I'm closing this out. |
I am not sure that this is actually solved because I just ran into this myself. I have several TB of large files that are infrequently accessed. I figured I would set primarycache=metadata to skip caching the file data since the files are unlikely to be accessed repeatedly. I turned it on and left it, but just discovered that I was only getting 4MB/s read speed vs the normal 180+MB/s. After some debugging I found the culprit to be primarycache=metadata. As soon as I set it back to all I was getting full speed again. This is definitely unrelated to the network because I was testing directly from disk using dd (with bs=4k) to check speeds. Edit: That also rules out metadata such as stat() being an issue. |
@rlifshay this topic should be discussed at mailing lists, but we definitely need some more information ( |
I am a developer myself, so I made a reproducible Vagrant environment to test this. I have attached my Vagrantfile so you can easily duplicate this yourself and inspect it (Github wouldn't let me upload it as is, so just remove the .txt extension to use it with vagrant). I have also included the pool and filesystem properties from the test pool. I can do the same for the pool I originally found the issue with if that is useful.
|
@rlifshay please read this topic, the answer was already here: Additionally, I advice you to change |
I did read the entire thread before I posted. I did not try adjusting either of those properties previously because they are both related to file attributes, not file data, and the issue is with read performance from a single file (as opposed to recursively listing files or something). I have modified my vagrantfile to set both of those properties just to make sure, but they had no effect. Here is a link to the updated Vagrantfile. |
@rlifshay IIRC Your vagrant file uses dd, not a samba, it's not an identical workload. Please, use our mailing lists for support questions, it's not a bug. |
I have the following system:
I noticed that Samba client access is not very 'snappy' when browsing through the top level directories of a Samba share. There are random delays, allthough throughput is OK.
Because ZFS will never be able to cache a big portion of 52 TB allocated disk space with only 28 GB of RAM for ARC, I thought it might be faster to set primarycache=metadata for all filesystems.
But that resulted in a drop from ~ 42 MB/s to ~ 2.5 MB/s when copying a 230 MB file.
Switching back to primarycache=all directly brought the Samba performance back.
Are you aware of this problem?
The text was updated successfully, but these errors were encountered: