lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

Restore upstream psutil or find an alternative

Open michaelsproul opened this issue 4 years ago • 5 comments

Description

We've moved to a fork version of psutil in https://github.com/sigp/lighthouse/pull/2699 to patch a vulnerable dependency. Once the vulnerable dep is patched upstream we should migrate back.

Tracking issue: https://github.com/rust-psutil/rust-psutil/pull/93

Alternatively we could move away from psutil entirely, the main competitor seems to be heim: https://crates.io/crates/heim

michaelsproul avatar Oct 10 '21 23:10 michaelsproul

We might want to shift away from psutil. They don't seem to be maintaining it well and I've had to upgrade their deps again: https://github.com/sigp/rust-psutil/tree/upgrade-deps

AgeManning avatar Nov 17 '21 02:11 AgeManning

I've also had to fork a dep of this, which also seems to be fairly unmaintained. https://github.com/AgeManning/darwin-libproc/tree/requirements

AgeManning avatar Nov 17 '21 02:11 AgeManning

https://github.com/GuillaumeGomez/sysinfo looks good as an alternative. 💡

I will investigate that whether there is any barrier to replace with it.

ackintosh avatar Apr 04 '22 07:04 ackintosh

I've investigated with sysinfo v0.23.6 (latest version).

I found that some of the metrics observed in Lighthouse are not supported by sysinfo. ref: common/eth2/src/lighthouse.rs#L197-L221

sysinfo doesn't support:

  • sys_virt_mem_cached
  • sys_virt_mem_buffers
  • system_seconds_total
  • cpu_time_total
  • user_seconds_total
  • iowait_seconds_total
  • idle_seconds_total

work in progress (https://github.com/GuillaumeGomez/sysinfo/pull/683):

  • disk_node_reads_total
  • disk_node_writes_total

I think...

sysinfo is not enough as an alternative for now, so we can't go to replace with it. But sysinfo is still a good candidate because:

ackintosh avatar Apr 05 '22 08:04 ackintosh

Here is my sandbox code for the investigate. (contains Japanese comment, sorry!)

ackintosh avatar Apr 05 '22 08:04 ackintosh