rdt-client icon indicating copy to clipboard operation
rdt-client copied to clipboard

High CPU Usage

Open CaddyV opened this issue 1 year ago • 21 comments

Hi!

Just got RDT - Client setup yesterday, and have been seeing extremely high CPU usage - is this expected?

  1. i5-9th Gen
  2. Windows 11
  3. 16GB of RAM
  4. Internal Downloader
  5. 256gb SSD for the OS/Docker
  6. NAS Drive for Storage
  7. Installed on Docker
  8. Currently set to 1 Chunk and 4 Parallel downloads, tried 8 Chunks and 8 Parallel
  9. Usage fluctuates between 75% ~ 300%, and my desktop sounds like a rocket and gets very slow. I don't see any other posts about this, so I presume it's an issue on my side?
  10. Download speeds fluctuate from 0 to 50MBps throughout
image

Thank you!

CaddyV avatar Feb 11 '24 11:02 CaddyV

Can you post a log? Maybe it's unpacking?

rogerfar avatar Mar 06 '24 01:03 rogerfar

I've got the same issue, running within docker on Windows 11. Xeon W-2145, 64 GB RAM, Internal Downloader, SSD for boot and docker.

As soon as a download is started, it eats up CPU for the entire machine. It doesn't appear to be an unpacking issue, as it starts as soon as a download is initiated.

Edit: Switching from the docker version to the Windows service version solved the issue for me. CPU usage is at max around 3% instead of 100%.

LemonsAndOranges avatar Mar 22 '24 02:03 LemonsAndOranges

Seeing a CPU issue with docker. I can just have it running with no downloads etc happening and it’s pushing my RPi4 hard.

What logs etc would be helpful to sort this one out?

mrman486 avatar Apr 04 '24 23:04 mrman486

Would be hard to debug, even with logs. What happens if you reduce the Check Interval?

Because when you're not on the web interface and you have no downloads it should be very idle.

rogerfar avatar Apr 10 '24 03:04 rogerfar

Sorry for getting back so late, will try switching to the Windows Service like LemonsAndOranges did!

CaddyV avatar Apr 10 '24 03:04 CaddyV

@LemonsAndOranges, @rogerfar - How did you get the Service working? I just get 'Stopped' when I check services. Don't see anything on my logs folder either

This is my appsettings.json. I tried without the double quotes as well. I'm using Windows, and installed ASP.NET as well.

{ "Logging": { "File": { "Path": "C:\Users\"User Name"\Documents\"RDT Client"\"RDT Logs"\rdtclient.log", "FileSizeLimitBytes": 5242880, "MaxRollingFiles": 5 } }, "Database": { "Path": "C:\Users\"User Name"\Documents\"RDT Client"\"RDT Database"\rdtclient.db" }, "Port": "6500", "BasePath": null }

CaddyV avatar Apr 10 '24 05:04 CaddyV

Switched to a shorter path which didn't have spaces, and got it working.

However, my system crashes near instantly when a download starts - I've got about 6 out of 16GB of RAM free but see this on the logs -

2024-04-10 13:45:40.024 +08:00 [ERR] RdtClient.Service.Services.Downloaders.InternalDownloader: Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) 2024-04-10 13:45:40.192 +08:00 [ERR] RdtClient.Service.Services.Downloaders.InternalDownloader: Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) 2024-04-10 13:45:40.192 +08:00 [ERR] RdtClient.Service.Services.Downloaders.InternalDownloader: Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) 2024-04-10 13:45:40.192 +08:00 [ERR] RdtClient.Service.Services.Downloaders.InternalDownloader: Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken) 2024-04-10 13:45:40.291 +08:00 [ERR] RdtClient.Service.Services.Downloaders.InternalDownloader: Exception of type 'System.OutOfMemoryException' was thrown. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.GC.AllocateNewArray(IntPtr typeHandle, Int32 length, GC_ALLOC_FLAGS flags) at System.Buffers.SharedArrayPool`1.Rent(Int32 minimumLength) at DownloaderNET.Downloader.Download(Int64 thread, Chunk chunk, CancellationToken cancellationToken)

Guess my desktop needs more RAM, will go back to Docker until I can add some.

CaddyV avatar Apr 10 '24 05:04 CaddyV

It really shouldn't use that much memory, can you show a screenshot of your settings, specifically the download client page.

rogerfar avatar Apr 10 '24 23:04 rogerfar

Strangely, all I see is one tab on the settings page.

I also noticed the following before my system crashed this time -

  • Download speeds while using the Windows version go up to 100MBps, whereas the Docker version stays around 5-10MBps, occasionally shooting upto 40MBps
  • Task Manager still showed about 5gb of RAM left, but my Chrome Tabs & Docker crashed, followed by the system crashing

Crash Settings

CaddyV avatar Apr 12 '24 03:04 CaddyV

Honestly I'm not sure at all, I don't think I've seen anyone else with this issue yet. But you're saying you see the same problem when running from Docker right? I assume that's on the same physical machine?

And you have no torrents loaded at all?

rogerfar avatar Apr 15 '24 00:04 rogerfar

I haven't faced this issue while using the Docker version. I tried both versions on the same physical machine.

Docker Version - Slower Downloads, was causing high CPU usage while downloading (No longer the case after restricting WSL resources)

Windows Version - 100MBps for the first minute or so until apps start getting killed and the desktop eventually crashes

CaddyV avatar Apr 18 '24 06:04 CaddyV

I had this issue while running the Windows version. I managed to resolve it however.

I just did a reinstall of .NET and deleted and reinstalled the RDC directory.

The only major differences I can think of is I changed the directory name to just RDC (from RealDebridClient) and where I stored the logs and DB file which are now:

"C:\RDC\db\ ..."

Finally I used Bezzad instead of the Internal downloader. I will re check tonight if the issue is replicable with the internal downloader.

Unfortunately I completely deleted everything from the first attempt so I haven't got the old logs to help you out Caddy (or you Roger) but I absolutely got the System.OutofMemoryException.

Specs: i5-9500T 8GB RAM (2666Mhz)

itinerantmarshmallow avatar Apr 18 '24 15:04 itinerantmarshmallow

I'll retry with the same steps as well, although my install of .NET was new.

I used C:\RDTClient - I had some issues when using a longer path / with a space (C:\RDT Client...) if I remember correctly. On my install, my settings page was blank so I couldn't switch to a different downloader.

My Docker version is working reliably, albeit with slow download speeds - but I'll give this a try again

CaddyV avatar Apr 24 '24 04:04 CaddyV

Try using the Aria2c downloader as a test, that really should keep the memory and CPU down of RDT.

rogerfar avatar May 03 '24 17:05 rogerfar

Try using the Aria2c downloader as a test, that really should keep the memory and CPU down of RDT.

Sure, will give that a shot as well. Also, thank you for RDT Client - really is epic. :)

CaddyV avatar May 04 '24 12:05 CaddyV