-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fragmentation is always 0 #2
Comments
Thanks for the report. I can confirm am seeing something similar here: I can add a variable to the dashboard (like the |
I don't feel having a variable is the right choice. Use fragmentation from telegraf input.zfs instead? |
I agree it's not an ideal choice. However in it's favour it does let the user specify exactly what vdev they mean in the case of >1 vdev in the pool: I think your second suggestion is the best approach for now- get the fragmentation values from the actual vdev[s] (ie not the disks, not root) and average† those. †: I can see edge cases where the average produces misleading results, like a tiny-but-highly-fragmented vdev with a huge-but-unfragmented vdev in a pool, but it's a start for now. |
That certainly not the right formula, but I would use the vdev size as a correction factor for the fragmentation, something like: |
Yup, that's a better approach; I'm not sure what data is available at the scope of that panel of the dashboard but it should be possible to pull it in (it's been some months since I looked at it) |
I don't have errors on my pool, but should be check if it's the same with checksum/read/write errors |
Good thinking, I checked one of those earlier in data explorer and it seems that the structures are indeed the same |
I have been working on this. The good news it's i) it's pretty easy to filter to vdevs (ignoring root and individual disks) ii) it's possible to pull in vdev and pool size: The bad-for-now news is i) I need to learn joins / pivots / unions (no combination of those has worked so far) ii) At some point I'll also need to figure out how best to test multiple vdevs, I might need to rig up something in a VM. Update +2.5h: The good: The bad: |
Can you share your influxdb query? |
The issue was to do with group keys (which influxdb data explorer
mostly ignores) and an apparent slight difference in how sum() work
between influxdb data explorer and grafana. I have yet to test with >1
vdev; I'll push out the query on a dev branch when I get back to my
PC.
…On Sun, 10 Sept 2023 at 09:48, sdalu ***@***.***> wrote:
Can you share your influxdb query?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Fragmentation was always being reported as 0% (issue #2) regardless of the actual fragmentation. This was due to the value generated by the zpool_influxdb for the pool being 0, whereas vdevs have fragmentation. So now we weight vdev fragmentations by pool size and sum to give an average: dev size frag note --- ---- ---- ---- eg vdev1 80GB 50% (contributes 4/5) vdev2 20GB 10% (contributes 1/5) pool 100GB → overall 50 * 4/5 + 10 * 1/5 = 42% weighted pool fragmentation Thanks to sdalu for reporting this.
Apologies for the delay in getting back to this- I lost the changes due to a browser segfault, thankfully I had an intermediate version saved elsewhere. I've split the query into a step-by-step process so it's hopefully a bit easier to understand. This is for the pool usage over time panel, for example:
It's not the prettiest, but it'll do for now. I've pushed this to a feature branch ( I would like to test it with multiple vdevs before I push out to main / grafana.com. |
I wrote a query to duplicate and modify a vdev for the purposes of testing. For those wanting to do the same, this should give you an idea of my approach:
It's ugly but it works. This leaves 'free', 'alloc' and indeed 'size' unchanged and with nonsense values but it at least let me test. This returned 42.7%, which is almost spot on I welcome further test cases or corrections, but I am happy enough that this works to the point of merging into |
Seems to fail to calculate fragmentation with a pool such as:
|
perhaps vdev should be selected as: |
I don't have fragmentation information on the
vdev=root
but on the vdev belows.In the following example fragmentation appear on
vdev=root/raidz-0
The text was updated successfully, but these errors were encountered: