hypercore-protocol / hyperdrive-daemon

Hyperdrive, batteries included.
MIT License
156 stars 24 forks source link

Increasing memory and processor pressure over time #85

Open da2x opened 3 years ago

da2x commented 3 years ago

Describe the bug The processor utilization grows over time. After a few hours, the daemon continuously uses 100% of one processor core. Likewise, the memory pressure steadily increases over time until the oom_reaper strikes it down.

To Reproduce Start hyperdrive-daemon and let it run for a day.

Expected Behavior The daemon functions with 0,4% processor utilization in the beginning. I don’t believe it should be sitting at 100% of one core after a few hours.

OS macOS 11 and 10.15, and Fedora Linux 32.

Node version v12.16.3

Was the daemon installed from NPM or bundled with Beaker? The issue appears in both situations, but quicker when bundled with Beaker (more Hyperdrives?)

urbien commented 3 years ago

I may have a related problem. I started playing with Beaker and noticed fans running on my Macbook Pro MacOS 10.15.6. Noticed hyperdrive process was using 1.7G of ram and high swapping. Killed it and now it is at 35Mb. Will watch it more and report.

da2x commented 3 years ago

@mafintosh @andrewosh just a hunch, but could this be related to copy-on-write filesystems and fragmentation in the hyper* storage files? Hyper is kind of the worst case scenario for CoW fs like APFS and Btrfs.