Random high CPU utilization on Synology 1813+ with Direct Stream

Server Version#: 1.13.5.5332-21ab172de
Player Version#: Android 7.3.2.6276 and iOS 5.2/5.3

I’m having a weird problem with Plex on my Synology 1813+ that I’ve been trying to figure out for weeks now. The issue is that Plex will randomly spike to use 100% CPU on my NAS, causing playback problems.

This didn’t used to be an issue. It seems to have started with an update that was available at the beginning of August. I don’t do any transcoding on Plex. Everything is played using Direct Stream on a local network. Randomly while playing, Plex will start using all available CPU on my NAS, which causes the video to keep stopping. When this issue occurs, the video being watched on either an iPad Air (iOS 11.4.1) or an Asus ZenPad 8 (Android 7.0).

I can confirm that it’s always using Direct Stream for both video and audio when this happens. Sometimes completely stopping the video and starting it again fixes the problem. Other times it’s just a crapshoot as to when it will start working properly again. A reboot of the NAS or restarting the Plex services also seems to fix the issue for a while.

When everything is working properly, I only have ~20% CPU utilization on the NAS.

Any suggestions what to look at to further troubleshoot this? I’m open to any suggestions.

In order to determine why that happened, I need a few pieces of information:

  1. Playback settings of the player
  2. XML of the item being played (Get Info -> View XML). This is the most important thing.
1 Like

I’ll need to get back with the iOS player settings, as my daughter doesn’t want to give me the iPad at the moment :slight_smile:

Android Player Settings

  • Video Quality - Home Streaming - Videos will play at maximum quaility
  • Audio boost - None
  • H264 maximum level - 4.1 (Recommended)
  • Audio passthrough - Disabled
  • Optional Audio Support - None
  • Use Android media player - Disabled
  • Use external player - Disabled

Example video #1

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="6" librarySectionTitle="Movies - Sophie" librarySectionUUID="ff277aa7-9ab9-4f72-8539-2c2b17677fbb" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1534565707">
<Video ratingKey="30675" key="/library/metadata/30675" guid="com.plexapp.agents.imdb://tt3655680?lang=en" librarySectionTitle="Movies - Sophie" librarySectionID="6" librarySectionKey="/library/sections/6" type="movie" title="Thomas & Friends: Sodor's Legend of the Lost Treasure: The Movie" contentRating="Not Rated" summary="Shiver me timbers. Surprises await Thomas and his friends as they dig up their most daring adventure yet. Unearthing an old pirate ship, Thomas is on the hunt for Sodor's lost treasure. When Thomas rocks the boat with some new friends, trouble soon rushes in. Will Thomas track down the treasure in time, or will Sailor John set sail with it? Join Thomas and Friends in this explosive movie adventure." rating="8.0" audienceRating="6.8" year="2015" thumb="/library/metadata/30675/thumb/1534227983" art="/library/metadata/30675/art/1534227983" duration="3778025" originallyAvailableAt="2015-07-17" addedAt="1533862660" updatedAt="1534227983" audienceRatingImage="rottentomatoes://image.rating.spilled" chapterSource="media" ratingImage="rottentomatoes://image.rating.ripe">
<Media videoResolution="480" id="35467" duration="3778025" bitrate="1475" width="720" height="480" aspectRatio="1.78" audioChannels="6" audioCodec="ac3" videoCodec="h264" container="mp4" videoFrameRate="24p" optimizedForStreaming="0" has64bitOffsets="0" videoProfile="high">
<Part accessible="1" exists="1" id="35548" key="/library/parts/35548/1529047645/file.m4v" duration="3778025" file="/volume1/video/Sophie's Shows/Movies/Thomas And Friends - Legend Of The Lost Treasure.m4v" size="696643252" container="mp4" deepAnalysisVersion="2" has64bitOffsets="0" optimizedForStreaming="0" requiredBandwidths="2852,2749,2749,2749,2749,2749,2749,2749" videoProfile="high">
<Stream id="25641" streamType="1" default="1" codec="h264" index="0" bitrate="1023" anamorphic="1" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" colorPrimaries="smpte170m" colorRange="tv" colorSpace="smpte170m" colorTrc="bt709" frameRate="23.976" hasScalingMatrix="0" height="480" level="40" pixelAspectRatio="32:27" profile="high" refFrames="5" requiredBandwidths="2404,2324,2324,2324,2324,2324,2324,2324" streamIdentifier="1" width="720" displayTitle="Unknown (H.264 High)"/>
<Stream id="25642" streamType="2" selected="1" default="1" codec="ac3" index="1" channels="6" bitrate="448" language="English" languageCode="eng" audioChannelLayout="5.1(side)" requiredBandwidths="448,448,448,448,448,448,448,448" samplingRate="48000" streamIdentifier="2" displayTitle="English (AC3 5.1(side))"/>
</Part>
</Media>
<Genre id="23" filter="genre=23" tag="Animation"/>
<Genre id="25" filter="genre=25" tag="Adventure"/>
<Genre id="26" filter="genre=26" tag="Comedy"/>
<Genre id="27" filter="genre=27" tag="Family"/>
<Genre id="52" filter="genre=52" tag="Fantasy"/>
<Director id="45865" filter="director=45865" tag="David Stoten"/>
<Country id="920" filter="country=920" tag="United Kingdom"/>
<Role id="46393" filter="actor=46393" tag="Eddie Redmayne" role="Ryan" thumb="http://image.tmdb.org/t/p/original/bHipa1GkpedD32w2OIRg5axdkQ6.jpg"/>
<Role id="8406" filter="actor=8406" tag="John Hurt" role="Sailor John" thumb="http://image.tmdb.org/t/p/original/rpuH2YRLpxJjMxHq4T1QdOSVtlN.jpg"/>
<Role id="8431" filter="actor=8431" tag="Jamie Campbell Bower" role="Skiff" thumb="http://image.tmdb.org/t/p/original/wzuENDUCak8HKRh72Jj7p3BQ7NY.jpg"/>
<Role id="5121" filter="actor=5121" tag="Olivia Colman" role="Marion" thumb="http://image.tmdb.org/t/p/original/3lcPisWEYVcDq09mFrqni3Nao0C.jpg"/>
<Role id="46399" filter="actor=46399" tag="Steven Kynman" role="Duck"/>
<Role id="46398" filter="actor=46398" tag="Nathan Clarke" role="Alfie"/>
<Role id="45883" filter="actor=45883" tag="Keith Wickham" role="Several characters" thumb="http://image.tmdb.org/t/p/original/4cBCajgznRpIDJ2ndvHMccOsEcV.jpg"/>
<Role id="45494" filter="actor=45494" tag="Teresa Gallagher" role="Emily, Daisy, Annie and Clarabel"/>
<Role id="45883" filter="actor=45883" tag="Keith Wickham" role="Edward, Henry, Gordon, James, Percy, Salty, Bert, Bertie and Sir Topham Hatt" thumb="http://image.tmdb.org/t/p/original/4cBCajgznRpIDJ2ndvHMccOsEcV.jpg"/>
<Role id="45885" filter="actor=45885" tag="Mark Moraghan" role="Narrator" thumb="http://image.tmdb.org/t/p/original/u7yVP128uK3xL1nj3dBwNbi0ItA.jpg"/>
<Role id="46392" filter="actor=46392" tag="David Bedella" role="Victor"/>
<Role id="46400" filter="actor=46400" tag="Tom Stourton" role="Rex" thumb="http://image.tmdb.org/t/p/original/1fUBK2bbdNOVXnzSlRKfXPvGmxD.jpg"/>
<Role id="45887" filter="actor=45887" tag="Rob Rackstraw" role="Toby"/>
<Role id="45895" filter="actor=45895" tag="Tim Whitnall" role="Mike and Oliver"/>
<Role id="46396" filter="actor=46396" tag="Jonathan Broadbent" role="Bill and Ben"/>
<Role id="46397" filter="actor=46397" tag="Matt Wilkinson" role="Cranky and Kevin"/>
<Role id="46394" filter="actor=46394" tag="Joe Mills" role="Donald, Douglas, Oliver and Toad"/>
<Role id="46395" filter="actor=46395" tag="John Hasler" role="Thomas (voice)"/>
<Extras size="0"> </Extras>
</Video>
</MediaContainer>

Example video #2

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="5" librarySectionTitle="TV Shows - Sophie" librarySectionUUID="30fa0942-0a53-4b0f-b0b3-9d5907a32b7a" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1534565707">
<Video ratingKey="31722" key="/library/metadata/31722" parentRatingKey="31645" grandparentRatingKey="31644" guid="com.plexapp.agents.thetvdb://267108/1/27?lang=en" librarySectionTitle="TV Shows - Sophie" librarySectionID="5" librarySectionKey="/library/sections/5" type="episode" title="Slow Quest" grandparentKey="/library/metadata/31644" parentKey="/library/metadata/31645" grandparentTitle="Sarah & Duck" parentTitle="Season 1" contentRating="TV-Y" summary="Tortoise is on a mission straight through Sarah and Duck’s house! The pair try to work out what he’s crawling towards." index="27" parentIndex="1" year="2013" thumb="/library/metadata/31722/thumb/1534208779" art="/library/metadata/31644/art/1534208801" parentThumb="/library/metadata/31645/thumb/1534208801" grandparentThumb="/library/metadata/31644/thumb/1534208801" grandparentArt="/library/metadata/31644/art/1534208801" grandparentTheme="/library/metadata/31644/theme/1534208801" duration="419320" originallyAvailableAt="2013-08-20" addedAt="1534125344" updatedAt="1534208779">
<Media videoResolution="1080" id="37734" duration="419320" bitrate="1118" width="1920" height="1080" aspectRatio="1.78" audioChannels="2" audioCodec="ac3" videoCodec="hevc" container="mkv" videoProfile="main">
<Part accessible="1" exists="1" id="37896" key="/library/parts/37896/1515600681/file.mkv" duration="419320" file="/volume1/video/Sophie's Shows/Sarah and Duck/Sarah & Duck - 2013 08 20 - 1x27 - Slow Quest.mkv" size="58614519" container="mkv" deepAnalysisVersion="2" requiredBandwidths="1108,1108,1108,1108,1108,1108,1108,1108" videoProfile="main">
<Stream id="31181" streamType="1" default="1" codec="hevc" index="0" bitrate="926" bitDepth="8" chromaSubsampling="4:2:0" colorRange="tv" frameRate="50.000" height="1080" level="150" profile="main" refFrames="1" requiredBandwidths="919,919,919,919,919,919,919,919" width="1920" displayTitle="Unknown (HEVC Main)"/>
<Stream id="31182" streamType="2" selected="1" default="1" codec="ac3" index="1" channels="2" bitrate="192" audioChannelLayout="stereo" requiredBandwidths="190,190,190,190,190,190,190,190" samplingRate="48000" displayTitle="Unknown (AC3 Stereo)"/>
</Part>
</Media>
<Extras size="0"> </Extras>
</Video>
</MediaContainer>

EDIT:

I should mention that it seems to be able to happen on pretty much any video. These are the most recent which had problems.

I can already see where, but it’s unclear to me why, the CPU is spiking. Apple doesn’t support HEVC in iOS 5 (it must be a really old iPad). That has to be transcoded. I do not know Android so cannot address it.

I do suspect, it’s the codec itself which is the root cause.

As first step in diagnosis, Find a movie which is codec=h264 and play it. If that plays flawlessly, you have the definitive answer.

The reason for this is the DS1813+ has an Atom D2700 CPU. It’s 64 bit, but only a dual core. If you loaded the 32 bit PMS from Synology, you’re also taking a performance hit. Until Synology makes all the changes. PMS from Package Center will be 32 bit.

I used to own a DS1813+ but outgrew it before it arrived. I outgrew the DS1815+ about a month after it arrived.

If you want to put yourself in a better position, I would recommend the DSx18+ class machines. They have full hardware transcoding and a much faster CPU. This issue will vanish in an instant.

I provided XMLs for 2 separate videos. The first is x264, which also exhibits this problem. Also, the iPad in question is an iPad Air on iOS 11.4.1.

Since all the videos are direct streaming when this issue happens, I don’t see how this can be an issue with the codec. There’s no transcoding happening on the NAS. I’ve confirmed the videos are direct streaming each time this issue happens. Also, this problem happens randomly. The same videos can play flawlessly other times, with extremely low CPU utilization on the NAS.

When I first installed Plex on the NAS, I did so through the package offered in Package Centre. Since then, I’ve been installing the stand-alone package files, which the Plex UI links to whenever an update is available. These packages are listed as 64-bit. I’m not sure if upgrading with the 64-bit packages ultimately gave me the 64-bit version or if I’m in some weird in-between state.

Oh, I misread. I apologize. You said iOS 5.2, I presumed you meant real iOS 5.2 and not Plex app 5.2.

In the iOS player, is it set for original quality or automatic / recommended ? Force it to maximum
Somewhere in your settings there’s a missed setting.

If this is a player issue, I will need to direct you to the iOS team. I’m a server guy.

I think the best next step is to ask you to recreate the problem and attach the ZIP log files with DEBUG logging only enabled. (not VERBOSE)

This way, I can follow the entire sequence from the press of Play until it starts and then plays for about 30 seconds.

One thing which does and will happen are the surges when PMS refills the app buffer. I do not know the buffer size but on the newer devices, they have a big buffer and I believe can hold up to 2 minutes worth of video.

Ah, yes. I was providing the app versions, not the OS :slight_smile:

The quality setting is on maximum for both the iPad and Android tablet. I’ll enable debug logging and make sure to grab the log the next time the problem occurs. Thanks for your help!

It happened again this morning. Here are the logs and the XML of the show that was being watched. The show was being watched on the iPad.

As in the past, the Plex Server showed it was using Direct Steam and was spiking the CPU of the NAS. This causes the client to keep buffering and complaining the server doesn’t have sufficient resources to play the video.

Plex Media Server Logs_2018-09-02_11-01-01.zip (2.1 MB)
31698.xml.zip (2.1 KB)

Thanks for looking at the logs.

The problem with high CPU utilization can happen with any video, including those in H264. I provided the XML of one of those videos above. I’ll get logs the next time the issue happens with one of those videos. Maybe it’s a completely different issue with the H264 videos.

The lines you quoted from the log show that transcoding was taking place, but my Plex Server interface showed that both video and audio were direct stream. Why would that be?

EDIT:

Also, the iPad Air that was playing this file is capable of playing 1080P HEVC content at up to 60fps. Is there a limitation in the iOS client that would cause transcoding to occur for this device when it’s capable of playing the file natively?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.