-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Space usage difference since upgrade #2497
Comments
To your original question, there are a few possibilities. Compression is certainly one. Dedup also if applicable. Different output is shown between If you've changed compression algorithms then maybe the older pool had some data compressed with different algorithms but now everything is re-compressed with a single algorithm resulting in different outputs. These are just a few possibilities. |
Thanks for the clarity. The compression algorithm is the same on both (lz4), and we are not using deduplication. Compression was set up initially the same when the pool was created (-Ocompress=lz4), but I think it's forced the same anyway because of zfs send -R. Interestingly, -R does not appear to propagate "xattr=sa", if that's of any relevance in space usage, but this time we set xattr=sa on the destination before starting the replication, to make sure all attributes are identical. The outputs of "zfs get all" and "zpool get all" are fundamentally the same, although 0.6.3 apparently adds a few new attributes that don't show up in 0.6.2. The following attributes appear on the 0.6.3 system that are not on 0.6.2: logicalused, logicalreferenced, acltype, context, fscontext, defcontext, rootcontext, relatime. I would understand minor differences, but in this case, it's amounting to hundreds of gigabytes of additional storage used (out of a few terabytes). |
'-R' "includes '-p'... |
Sorry, not sure what you mean by that, i.e., your point? |
Why it differ 10% I don't know. Copies? |
There are no copies, it's an exact replica. Same script used in 0.6.2 and the space used was essentially identical. The command being used is essentially like this: zfs send -v -R -I ds/ds1@replication-snapshot ds/ds1@replication-snapshot | rsh 10.0.0.x zfs receive -F ds/ds1 Theoretically, all properties of the source filesystem should get replicated because of -R. As I mentioned previously, the xattr attribute is not getting propagated, but that's a different matter and doesn't account for the difference in space used. |
fyi, this continues to be a problem. The receiving filesystem is down to less than 25GB free while the sending filesystem has over 630GB free space. Or, put another way, the origin filesystem is using 4.49T, while the destination is using 4.94T, still a difference of around 10%. I can't think of a reason other than compression somehow being less effective in the newer code, which seems almost impossible, but all I can say is that before upgrading to 0.9.3, the two systems stayed nearly identical in space used. I was thinking of destroying the destination and re-sync'ing everything just to be sure, since we're going to run out of space in a few days if we don't do that. But before I try that, is there anything we could look at that would be useful to help track this down? |
@ldonzis Is the pool geometry the same for both pools. For example are the both built from mirrors or are they both raidz? Depending on the exact geometry space is consumed slightly differently. |
Yeah, they're identical (even same host adapters & drives, not that it matters). Each system has eight drives, configured as two raidz1 vdevs of four drives each. (This was due to my belief from reading various tips that this would perform better than one vdev using raidz2.) They've been that way for quite a long time, but I first noticed the change after upgrading the backup/receiving side to 0.6.3. The primary/sending side is still running 0.6.2. Here's the primary (sending) side: root@ss1:
and here's the backup/receiving system: root@ss2:
|
ashift the same on both? |
Good question, but they are the same (both zero). All of the pool properties are the same except guid and the space used. |
Good thought. Use 'zdb -l ' to get the ashift for each vdev. I'm also going to assume you don't have any snapshots laying around. |
Aha! It's "9" on the sending side and "13" on the receiving side. Oh, and there are snapshots... a little under 800 of them. I never set the ashift, and the drives have 512-byte sectors. How did it get set to 13? Or, I guess better question is, how to set it to 9? Sure seems like you're on to something! |
as i said, IIRC there was a change in the default behaviour in 0.6.3 #967 |
Ah, got it. Actually, it looks like there is a table of drives in the source that causes, in this case, ashift to default to 13. I presume this is believed to provide better performance? I ran a quick bonnie++ with ashift=9 and ashift=13 and the difference appears to be within the margin of error of the test, perhaps because with compression, it's greatly CPU bound anyway. In any event, for the moment, we can't tolerate the 10%-ish space loss, so I'll rebuild the pool with ashift=9. I'm sorry to waste everyone's time with this. It never occurred to me to look at ashift with zdb instead of zpool. |
Just to add a little closure/validation, I re-created the pool, forcing ashift=9, and re-sync'ed, and now the space usage is the same on both sides. Thanks very much for your help, and I apologize for the red herring. |
@ldonzis I'm glad you got to the root cause here. |
We have two systems that are kept synchronized through zfs send / zfs receive. Normally, the disk space usage on the two is identical, or at least extremely close.
Since installing 0.6.3 on the secondary server (was previously running 0.6.2), destroying the pool, and doing a complete re-sync with "zfs send -R", the space used is now quite different, about 10% higher as a rough guess. (Roughly 400GB out of 4TB).
I did notice that we had set "xattr=sa" on the source filesystems, and that attribute did not get replicated through the send/recv. But after starting over and setting xattr=sa on the destination filesystems, that made no difference.
Is there any reason that space usage on filesystems using 0.6.3 would be higher than 0.6.2?
As an aside, when blocks are sent and received, are they transferred in the native compressed format, or are they uncompressed, transferred, and then re-compressed on the destination? Just curious, thanks.
The text was updated successfully, but these errors were encountered: