asapach / peerflix-server

Streaming torrent client for Node.js with web ui.
MIT License
1.31k stars 586 forks source link

High RAM and CPU usage while torrents are idle? #175

Closed lordlycastle closed 4 years ago

lordlycastle commented 4 years ago

I have been using this package on a Ubuntu VPS and noticed that the node process uses about 40-45% CPU time (jumps to 60% randomly for 5-10 secs) on decent machine when it not even downloading. And RAM use is around 35% == 3GB when it’s not seeding or downloading.

I have ~20 ‘loaded’ movie torrents in the app; not running. All have finished downloading and are paused. I haven’t removed them because by default removing them deletes the file and don’t want do that before watching. They’re not seeding anymore just paused. I’ve set upload connections to 10 as well.

Can there be a culprit for this CPU stress? I’ve no custom code so what are other people’s experiences. Is there a way to optimize.

I suppose I can change the code to not delete the file on remove and remove them when done but then I’ll need to find other way to manage files. Anyone got recommendations for web based file manager (which perhaps has a better web player for viewing files)?

Processor:    Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz
CPU cores:    4
Frequency:    2199.996 MHz
RAM:          7.8G

I’m new to node so still figuring out how to create an app that has this plus other tools like file manager and featured video player for extreme streaming experience. Does peerflix-server only provide the server and web UI functionality with torrent stream doing the torrent related things? Thx for the work you Putin.

asapach commented 4 years ago

That does seem excessively high. Is there any activity in the logs? Are you sure nobody else is accessing the server?

lordlycastle commented 4 years ago

@asapach thx for the reply.

I’ve added swim’s logs here. They seem quiet as far as I can tell. I was running it through forever.

I don’t think anyone else is accessing it. At least no one has added new torrents and they could just be streaming through the web (it’s not listed anywhere but I have yet to add password protection).