Networking challenge

Who’s up for a challenge? Here’s my problem. Pretty much every time when I watch a show, at some point the video will stop completely. If I am watching in a browser, it will then drop back to the plex screen where I hit “Play”. If I was chromecasting, it will drop back to the plex logo. Sometimes there’s a generic error message about not being able to play the content, and sometimes there’s no message at all. So, everything seems to be set up correctly because I can play videos, but I keep getting these random stoppages. It does not seem to be related to the media in that it will not stop at the same point in the video if I play it again. Rather, I am pretty sure it is related to networking somehow…

When I look in the plex logs, there’s always an error logged at the same time as the crash. Typically it starts with this:

Jan 19, 2016 06:51:29 [0x7fc322bff700] VERBOSE - doShouldThrottleTranscodeNow: m_lastChunkWritten = 668, m_lastChunkRead = 635, chunksToThrottle = 32 (session: bwsfbe6ww0lwstt9)
Jan 19, 2016 06:51:29 [0x7fc322bff700] DEBUG - It took 0.0 sec to serialize a list with 0 elements.
Jan 19, 2016 06:51:29 [0x7fc32dbfe700] DEBUG - Completed: [127.0.0.1:47644] PUT /video/:/transcode/session/bwsfbe6ww0lwstt9/progress?progress=49.6&size=2808461604&remaining=63752 (11 live) 1ms 305 bytes 206
Jan 19, 2016 06:51:30 [0x7fc32e3ff700] DEBUG - EventSource: Failure in IdleTimeout (0 - Success).
Jan 19, 2016 06:51:30 [0x7fc32e3ff700] DEBUG - MyPlex: We appear to have lost Internet connectivity, resetting device URL cache.
Jan 19, 2016 06:51:30 [0x7fc32e3ff700] ERROR - EventSource: Retrying in 15 seconds.
Jan 19, 2016 06:51:30 [0x7fc315bff700] DEBUG - Request: [127.0.0.1:47645] PUT /video/:/transcode/session/bwsfbe6ww0lwstt9/progress?progress=49.6&size=2808506172&remaining=65271 (11 live)

And then a few seconds later
Jan 19, 2016 06:52:05 [0x7fc32dbfe700] DEBUG - EventSource: Failure in IdleTimeout (0 - Success).
Jan 19, 2016 06:52:05 [0x7fc32dbfe700] DEBUG - MyPlex: We appear to have lost Internet connectivity, resetting device URL cache.
Jan 19, 2016 06:52:05 [0x7fc32dbfe700] ERROR - EventSource: Retrying in 15 seconds.

And then again
Jan 19, 2016 06:52:11 [0x7fc322bff700] DEBUG - It took 0.0 sec to serialize a list with 0 elements.
Jan 19, 2016 06:52:11 [0x7fc32dbfe700] DEBUG - Completed: [127.0.0.1:47735] PUT /video/:/transcode/session/bwsfbe6ww0lwstt9/progress?progress=49.7&size=2810350345&remaining=86780 (13 live) 1ms 305 bytes 206
Jan 19, 2016 06:52:11 [0x7fc32e3ff700] ERROR - handle_stream_read error 104 Connection reset by peer
Jan 19, 2016 06:52:11 [0x7fc32e3ff700] VERBOSE - [TranscodeOutputStream] Told to teardown
Jan 19, 2016 06:52:11 [0x7fc32e3ff700] DEBUG - Removed transcode output stream 0x7fc328ec5000, active count 1 => 0
Jan 19, 2016 06:52:11 [0x7fc321bff700] DEBUG - [TranscodeOutputStream] Input processing thread exited after writing 2665575369 bytes, m_closed=1, m_endOfFileReached=0, session->isStopped()=0

So, I was thinking it might be related to networking. So I set up a script to ping google, my gateway (192.168.1.1) and localhost every 15 seconds from the plex server. Sure enough, when the crash happens, I can’t ping google or the gateway. Localhost is still successful. I also have a script running on a separate computer that pings the gateway every 15 seconds and that has no problems even when the crash happens. So I don’t think it is anything wrong with the router. So it has to be something in the server. I think. On the other hand, for the hours and hours in between movies, not a single dropped ping. The networking only stops when Plex is running.

By the way, this is a 14.04 Ubuntu server, and all of the updates are installed. The CPU is an Intel i3 3220 (passmark = 4200) and 8gb RAM.

OK, ninjas, what’s next? Everything was working great until maybe a few weeks ago. Watching shows like crazy with no problems at all. But now all of a sudden, I can’t complete a single show without a crash.

If anyone wants a full log, here you go:
http://pelorus.org/files/PlexLog_20160119a.log

Router might be giving up the ghost? Internet provider is forcing a new IP on the router? Router getting too hot and rebooting? Problem on the internet line coming in to the house?

Those are all problems with something outside of the Plex machine, so that’s where I would start looking.

A failing router has definitely crossed my mind. Although, the troubleshooting I have done so far seems to point to something other than that. I have just enabled logging on my router (DD-WRT firmware), so I will try and make it fail again and see if there is anything interesting in the logs.

which router do you have?

check out nload, to see how traffic is behaving.
How about ifconfig?

eth0
RX packets:36879564 errors:83 dropped:0 overruns:82 frame:1
TX packets:36171862 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000

(I have errors there since i did something daft.

My bet is router is having a bad time, or even chromecast, i had issues with chromecast 1, but CC2.0 works just fine.

I have the Netgear WNDR 4000 with DD-WRT firmware. nload isn’t showing anything interesting, but I do see something going on with ifconfig that I hadn’t seen before. I have thousands of dropped RX packets that only come up when running plex. The entire time I am streaming something, the dropped RX count just keeps on increasing and increasing. Does that seem normal? Perhaps dropped RX packets isn’t as bad as it sounds? And if it is a clue as to what is going on, any ideas on how to fix it.

One other test I need to do it check for dropped packets when streaming to an android device. I haven’t had any problems streaming to android. Not even a pause of stutter. So I will do that test and see if there are any dropped packets with that.

I am reading up on the dropped RX packets. It seems that it indeed may not be a bad thing to see dropped RX packets from the ifconfig output.
https://www.novell.com/support/kb/doc.php?id=7007165
I have not tried putting my card into promiscuous mode and restesting. In the meantime, it would be helpful if some of you that have plex on a linux box could run ifconfig while streaming a show to a web browser and see if you are showing dropped RX packets. I’m at work now so I won’t be able to get back to testing for a few more hours.

Answering for historical purposes. I ended up upgrading CPU & motherboard to something with more beef and it has been doing fine for the past year.