cjbassi / ytop

A TUI system monitor written in Rust
MIT License
2.16k stars 84 forks source link

disks having incorrect R/W values #103

Open icanc0 opened 4 years ago

icanc0 commented 4 years ago

so this is running on a pi 4 with usb boot, tested on both pi 4s, results are the same

you can see down below where the R/W are always the same, and the unit arent right, since I have a nextcloud instance running and writing around 20 MBs per sec

image image image

any ideas why?

CosmicHorrorDev commented 4 years ago

97 might fix this.

icanc0 commented 4 years ago

so i just compile ytop with the changes right?

CosmicHorrorDev commented 4 years ago

Yeah you can try pulling the PR and seeing if it fixes it for you. I have noticed incorrect disk activity readings, but I haven't taken the time to see if that PR fixes things for me.

barryprice commented 4 years ago

Seeing slightly different issues on an Ubuntu amd64 system, read/write values are constantly 0 for me.

PR #97 compiles and runs fine here, but doesn't change the output for me.

CosmicHorrorDev commented 4 years ago

Hmmm, I see low values, but definitely not zero. I've got access to an amd64 system so I can try livebooting and seeing if I can reproduce the issue. Can I have some more information on your version of ubuntu and any information about the disks (your fstab should give me enough information).

I should be able to make time in a couple days to try and reproduce and get back to you @barryprice.

barryprice commented 4 years ago

@LovecraftianHorror sure, this is 20.04 LTS, my native setup is a bit weird with lots of ZFS subvolumes but I can reproduce in a bog-standard VM which makes things simpler.

Disk layout is very basic:

ubuntu@ytoptest:~$ blkid /dev/sda*
/dev/sda1: LABEL="cloudimg-rootfs" UUID="88baefc0-b766-40e9-865f-a671c43d0628" TYPE="ext4" PARTUUID="bb7d4753-c5cd-435f-b473-fb12c4fa2aa2"
/dev/sda15: LABEL_FATBOOT="UEFI" LABEL="UEFI" UUID="69C1-6F66" TYPE="vfat" PARTUUID="7f6ef26a-860a-4ef0-867f-916c55eb246f"
ubuntu@ytoptest:~$ cat /etc/fstab 
LABEL=cloudimg-rootfs   /   ext4    defaults    0 0
LABEL=UEFI  /boot/efi   vfat    defaults    0 0
ubuntu@ytoptest:~$ ./ytop

Running ytop, either as a binary from the 0.6.2 release, or compiled from source (with and without #97 applied) all the values look correct except for constant zeroes for R/s and W/s, even when running e.g. dd in another tab to force activity:

Disk Usage
Partition                  Mount                      Used  Free     R/s      W/s
sda1                       /                           26%  3.43 GiB 0 bytes  0 bytes
sda15                      /boot/efi                    4%  101 MiB  0 bytes  0 bytes
CosmicHorrorDev commented 4 years ago

@barryprice So I installed an Ubuntu 20.04.1 Desktop VM to test it out and I get low, but still non-zero values when testing out reads and writes. However, you did mention that your native setup is ZFS which I believe (if my memory is correct) that the library we use for disk information does not detect reads and writes. Luckily I have access to a server with a ZFS array and was able to verify that both reads and writes remain 0 on it. I'm not able to install a VM on the server though to test out that, but regardless I'll start trying to add better ZFS support which may fix the problem!

barryprice commented 4 years ago

Thanks - I can file a separate issue for ZFS reads/writes not showing up if that helps.

I'm surprised that a ZFS-backed VM is affected in the same way though, the VM shouldn't know or care what kind of backing device is behind its own "/dev/sda" as far as I can see.

Let me know if I can further provide anything useful here, and thanks for taking the time!