• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting High CPU usage

    Pages (4): « Previous 1 2 3 4

     
    • 0 Vote(s) - 0 Average

    High CPU usage

    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #31
    2024-01-23, 06:06 PM
    (2024-01-23, 01:35 PM)spanky34 Wrote: Can I DM you the logs? I have multiple users and don't want to publicly post the logs due to potentially identifiable information.  Also... log apparently is too large for both locations.  Might have to truncate the logs into multiple posts.  The logs for the day are about 8MB.

    Sure.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    JoeyG1973
    Offline

    Junior Member

    Posts: 2
    Threads: 0
    Joined: 2024 Jan
    Reputation: 0
    Country:United States
    #32
    2024-01-23, 10:34 PM (This post was last modified: 2024-01-23, 10:42 PM by JoeyG1973. Edited 1 time in total.)
    Going to throw my interesting discovery in here.

    This is happening when I play a 4k steam with subtitles.  It's a .mkv and I thought that having the subtitles extracted would reduce the load, but to no avail.  Guess that subtitles are added to the video stream on the fly, which now that I think about it, is exactly what is happening.  Still it makes no sense why I have such a high cpu load.  I have a Nvidia P400 and before I got CUDA setup working with Jellyfin if I played the same stream with subtitles, it simply would lock up and not play, which makes sense considering I am rocking a "Intel® Core™ i7-4790 CPU @ 3.60GHz".  I know it is working because nvidia-smi says as much.

    I would have thought that having all this transcoding off loaded to the GPU would not have impacted the CPU as much as it does.

    All this said, videos play smooth with subtitles in 4k on my local network.  Not something I can say worked with Plex.  Same setup with Plex and it was constantly buffering on the client end.

    Running straight on Fedora 39.

    root@gpm:~# rpm -qa | grep jellyfin
    jellyfin-firewalld-10.8.13-1.fc39.noarch
    jellyfin-server-10.8.13-1.fc39.x86_64
    jellyfin-web-10.8.13-1.fc39.noarch
    jellyfin-10.8.13-1.fc39.x86_64

    I also hacked /etc/jellyfin/encoding.xml to use the jellyfin-ffmpeg portable I got from here https://github.com/jellyfin/jellyfin-ffmpeg/releases however it doesn't seem that much more efficient than the one that comes with Fedora 39.  And yes you need to hack it into that file because it is not something that you can change from the UI.  Added the following 2 lines.

      <EncoderAppPath>/usr/local/jellyfin-ffmpeg/ffmpeg</EncoderAppPath>
      <EncoderAppPathDisplay>/usr/local/jellyfin-ffmpeg/ffmpeg</EncoderAppPathDisplay>

    I want to know why the CPU is still screaming even with the work being offloaded to the GPU.  To add to this after about 15-30 minutes of playing the stream, the ffmpeg just goes away until I stop the client playback and start again.  The box is still snappy though even with all of this CPU load.

    Any thoughts on this? 


    Code:
    root@gpm:~# nvidia-smi
    Tue Jan 23 17:27:39 2024
    +---------------------------------------------------------------------------------------+
    | NVIDIA-SMI 545.29.06              Driver Version: 545.29.06    CUDA Version: 12.3    |
    |-----------------------------------------+----------------------+----------------------+
    | GPU  Name                Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
    | Fan  Temp  Perf          Pwr:Usage/Cap |        Memory-Usage | GPU-Util  Compute M. |
    |                                        |                      |              MIG M. |
    |=========================================+======================+======================|
    |  0  Quadro P400                    Off | 00000000:01:00.0 Off |                  N/A |
    | 43%  53C    P0              N/A /  N/A |    192MiB /  2048MiB |    12%      Default |
    |                                        |                      |                  N/A |
    +-----------------------------------------+----------------------+----------------------+

    +---------------------------------------------------------------------------------------+
    | Processes:                                                                            |
    |  GPU  GI  CI        PID  Type  Process name                            GPU Memory |
    |        ID  ID                                                            Usage      |
    |=======================================================================================|
    |    0  N/A  N/A    380547      C  /usr/local/jellyfin-ffmpeg/ffmpeg          188MiB |
    +---------------------------------------------------------------------------------------+


    Running top and I can clearly see that ffmpeg is trying to break the box.
       

    htop doesn't look much better
       

    This is the full command that is running:

    Code:
    root@gpm:~# ps -eaf | grep 380547
    jellyfin  380547  283992 99 17:27 ?        00:22:28 /usr/local/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -ss 01:53:21.000 -init_hw_device cuda=cu:0 -filter_hw_device cu -autorotate 0 -canvas_size 2582x1080 -i file:/mnt/data/media/movies/Dune (2021)/Dune.2021.PROPER.UHD.BluRay.2160p.10bit.DoVi.2Audio.TrueHDAtmos.7.1.x265-b.mkv -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:2 -map -0:0 -codec:v:0 h264_nvenc -preset p1 -b:v 54566883 -maxrate 54566883 -bufsize 109133766 -g:v:0 72 -keyint_min:v:0 72 -filter_complex [0:5]scale=s=3840x1606:flags=fast_bilinear[sub];[0:0]setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(3840\,1606*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(3840/a\,1606))/2)*2,format=yuv420p[main];[main][sub]overlay=eof_action=endall:shortest=1:repeatlast=0 -start_at_zero -codec:a:0 copy -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 2267 -hls_segment_filename /var/lib/jellyfin/transcodes/b98168691b3c4e21493476b9dd6e04c4%d.ts -hls_playlist_type vod -hls_list_size 0 -y /var/lib/jellyfin/transcodes/b98168691b3c4e21493476b9dd6e04c4.m3u8
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #33
    2024-01-23, 10:46 PM (This post was last modified: 2024-01-23, 10:47 PM by TheDreadPirate. Edited 1 time in total.)
    If you are also transcoding audio, that will occur on the CPU. If your GPU is blowing through the video, your CPU will have to keep up.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    JoeyG1973
    Offline

    Junior Member

    Posts: 2
    Threads: 0
    Joined: 2024 Jan
    Reputation: 0
    Country:United States
    #34
    2024-01-23, 11:05 PM
    How do I know if I am transcoding audio? How come ffmpeg only fires up when I turn on subtitles? I play the same stream, Dolby Digial EX Audio 5.1 @ 448 kbs, both with and without subtitles like as mentioned, it only fires up ffmpeg with subtitles enabled.

    My curiosity is killing me here and I am trying to understand. Smiling-face
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #35
    2024-01-24, 12:50 AM
    Depending on the client, when video is transcoded the audio is also transcoded. If you share the ffmpeg log with us we could figure that out.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    joeblackdandt
    Offline

    Junior Member

    Posts: 1
    Threads: 0
    Joined: 2024 Mar
    Reputation: 0
    Country:United States
    #36
    2024-03-08, 06:57 PM
    Sorry for jumping in out of nowhere, but I am facing a similar issue, once I start watching something, anything, it just makes the CPU stay above 94% for hours until I end up restarting jellyfin. I am running Jellyfin on Terramaster NAS F2-221. No issues with watching videos, it just triggers the CPU like this. I ran ps aux, result attached.

    Thanks in advance


    Attached Files
    .txt   jellyfin_ps1.txt (Size: 982 bytes / Downloads: 93)
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #37
    2024-03-09, 12:52 AM
    Looks like it is transcoding. Does the CPU usage return to normal after you stop watching the video that triggered the transcode?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    tsgillx
    Offline

    Junior Member

    Posts: 10
    Threads: 1
    Joined: 2024 Jan
    Reputation: 0
    #38
    2024-03-09, 06:12 PM
    No it does not turn to normal. Since I was transitioning from Plex to Jellyfin I left plex running too. Seems like if Plex is running on the TrueNAS server at the same time it causes the high cpu usage. Not sure why. I just turned PLEX off now it is running very smootly.

    Now i need to find a way to syn somehow free plex watch history with Jellyfin. I dont have plex pass Smiling-face
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #39
    2024-03-09, 06:51 PM
    How are you installing Jellyfin on your NAS? From Asustor's app store? Or a docker image? If docker, which one? Can Asustor NASes run docker?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    spanky34
    Offline

    Junior Member

    Posts: 10
    Threads: 0
    Joined: 2023 Jun
    Reputation: 0
    Country:United States
    #40
    2024-05-12, 04:28 PM
    Resurfacing to mention I found the source of my issues.

    It was related to remote users having content paused and then the screensaver taking over. I FINALLY got everyone to confirm the screensavers are disabled on their AndroidTV clients (firetv and CCWGTV) and the high CPU usage went away. It's been about 10 days of quiet over here.
    Pages (4): « Previous 1 2 3 4

    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode