Question / Help Random drops for LAN nginx server

sneaky4oe

Member
I have a lan with ubuntu, nginx and ffmpeg to transcode my stream from a videocard. This exact software config worked for me a year ago or so with a different ubuntu server version.
I bought myself a new router to see if it the old one was failing. Same problem with it. Really different models in different price segments.
Server's motherboard was great at streaming, it's basically my old pc.

Now I'm at a new ryzen build as a main pc. I updated network drivers for windows system top be sure it's not it.

Problem:
The issue is there for a long time. Sometimes, in a few multiplayer games like PUBG, mostly at the starting plane stage, and in RUST when I share a sleeping bag to someone or do other manipulations that require player list loading, my OBS disconnects from my local server and reconnects almost instantly (2 seconds cooldown). Stream drops out, my viewers are mad, I'm upset. It doesn't really matter if I encode with my ubuntu server or stream through it. In some games I loose some packages or get a "bad header" on ffmpeg side. Other games work flawlessly for 3-5 hours straight.

Question:
Is there a way to set highest network priority for obs somehow?

If it helps, here's my router's (openwrt LEDE) graph of network traffic from my main PC at lagspike moment.
4 minute window, 3 seconds interval.

niyBUAt.png
 
Last edited:
Ryzen 1700x@3.8 8c/16t with 32 gigs ram at 2933. CPU is at ~30% while streaming because I use nvenc or amf as my encoders most of the time.
But even if I use my CPU as encoder and it gets to about 75%, and I stream with that server, I still get drops.
 
Yeah, tried my best with it... still no result. Trying some different approaches. Will report on success here for google...
 
Is the streaming PC connected to the gaming PC through the same router that is used for internet connection with the world?
 
Yes, but as I said in op post, I've bought myself a completely new router, a more expensive one, to see if it's failing. It's not.
 
Mainly because it's expensive to buy even more networking hardware just to test obs... And sending to local nginx on windows that transmits stream to linux nginx for encoding results in the same problem. OBS works flawlessly, but packets are lost. :-( I've already exceeded my spending limits for this month...
 
It looks like the networking hardware either on one of your computers or the switch in between (even the one built into the router) is crapping out.
 
So, I've done some testing.

It looks like I can stream to my laptop's nginx directly and then spread my stream to the platforms I need. The bitrate was 6mbit/s. 3 times without drops.
Then I started streaming to local nginx and through it was streaming to both my laptop (many platforms, 6mbit/s) and my server (6mbit/s, no transcoding, one platform). Both side nginxes worked fine. 2 hours stream - no drops.
I also enabled QOS at my router for 100mbit/s.

But before that laptop testing and router configuration I had drops even in singleplayer games and games that normally behaved well.

Now I decided to freshly install ubuntu server (oem, just to see). Copied my config from the last server, and started streaming to my encoder application at 35 mbit/s. Lots of drops. Turned down to 10 mbit/s. Same...

OBS log file: https://gist.github.com/93a2efa02c10af6ddc5a5f88bcfb827f

Freshly installed server's nginx logs:
oem@Restreamer:/usr/local/nginx/logs$ cat error.log
2017/08/19 17:34:14 [error] 12641#0: *1 open() "/usr/local/nginx/html/favicon.ico" failed (2: No such file or directory), client: 192.168.0.33, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.0.55", referrer: "http://192.168.0.55/"
2017/08/19 17:41:47 [notice] 1770#0: signal process started
2017/08/19 17:41:47 [error] 1770#0: open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
2017/08/19 17:42:24 [notice] 1782#0: signal process started
2017/08/19 17:42:28 [notice] 1790#0: signal process started
2017/08/19 17:44:17 [alert] 1794#0: unknown process 1795 exited on signal 9
2017/08/19 17:44:24 [alert] 1794#0: unknown process 1832 exited on signal 9
2017/08/19 17:47:40 [alert] 1794#0: unknown process 1833 exited on signal 9
2017/08/19 17:47:48 [alert] 1794#0: unknown process 1869 exited on signal 9
2017/08/19 17:52:15 [alert] 1794#0: unknown process 1905 exited on signal 9
2017/08/19 17:53:10 [notice] 2058#0: signal process started
2017/08/19 17:54:06 [alert] 2064#0: unknown process 2068 exited on signal 9

oem@Restreamer:/usr/local/nginx/logs$ cat access.log
192.168.0.33 - - [19/Aug/2017:17:34:13 +0300] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.91 Safari/537.36 Vivaldi/1.92.917.39"
192.168.0.33 - - [19/Aug/2017:17:34:14 +0300] "GET /favicon.ico HTTP/1.1" 404 570 "http://192.168.0.55/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.91 Safari/537.36 Vivaldi/1.92.917.39"
192.168.0.33 [19/Aug/2017:17:44:17 +0300] PUBLISH "transcode-test" "1234" "" - 52306806 529 "" "FMLE/3.0 (compatible; FMSc/1.0)" (37s)
127.0.0.1 [19/Aug/2017:17:44:17 +0300] PUBLISH "tester" "1234" "" - 19972653 409 "" "" (32s)
127.0.0.1 [19/Aug/2017:17:44:17 +0300] PLAY "transcode-test" "1234" "" - 838 52306973 "" "" (37s)
192.168.0.33 [19/Aug/2017:17:44:24 +0300] PUBLISH "transcode-test" "1234" "" - 4230 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (4s)
127.0.0.1 [19/Aug/2017:17:44:24 +0300] PLAY "transcode-test" "1234" "" - 321 1296 "" "" (4s)
192.168.0.33 [19/Aug/2017:17:47:40 +0300] PUBLISH "transcode-test" "1234" "" - 805867506 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (3m 12s)
127.0.0.1 [19/Aug/2017:17:47:40 +0300] PUBLISH "tester" "1234" "" - 140906250 409 "" "" (3m 10s)
127.0.0.1 [19/Aug/2017:17:47:40 +0300] PLAY "transcode-test" "1234" "" - 8323 805866422 "" "" (3m 12s)
192.168.0.33 [19/Aug/2017:17:47:48 +0300] PUBLISH "transcode-test" "1234" "" - 18214034 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (5s)
127.0.0.1 [19/Aug/2017:17:47:48 +0300] PUBLISH "tester" "1234" "" - 2122040 409 "" "" (3s)
127.0.0.1 [19/Aug/2017:17:47:48 +0300] PLAY "transcode-test" "1234" "" - 478 18212630 "" "" (5s)
192.168.0.33 [19/Aug/2017:17:52:15 +0300] PUBLISH "transcode-test" "1234" "" - 1146182621 409 "" "FMLE/3.0 (compatible; FMSc/1.0)" (4m 23s)
127.0.0.1 [19/Aug/2017:17:52:15 +0300] PUBLISH "tester" "1234" "" - 199630584 409 "" "" (4m 21s)
127.0.0.1 [19/Aug/2017:17:52:15 +0300] PLAY "transcode-test" "1234" "" - 11713 1146181221 "" "" (4m 23s)
192.168.0.33 [19/Aug/2017:17:54:06 +0300] PUBLISH "transcode-test" "1234" "" - 215147088 529 "" "FMLE/3.0 (compatible; FMSc/1.0)" (52s)
127.0.0.1 [19/Aug/2017:17:54:06 +0300] PUBLISH "tester" "1234" "" - 36906572 409 "" "" (48s)
127.0.0.1 [19/Aug/2017:17:54:06 +0300] PLAY "transcode-test" "1234" "" - 2438 215147063 "" "" (52s)

oem@Restreamer:/usr/local/nginx/logs$ cat nginx.pid
2063

So, it looks like it's my server side problem, but I'm not sure how to fix iit, since I tried two different ubuntu distrubutions.
My server setup process is mostly described here:
https://pastebin.com/viXQTKMh

What am I doing wrong? Even on 100mbit/s router 35 mbit and even 10 isn't such a big deal...
 
Last edited:
Looks like setting chunk_size to 16777215 allows me to stream even at 50 mbit/s for like 20 minutes (didn't have more time to test this). But compared to what I had when it was set to 4k, and constant disconnects every few seconds, this may actually be the issue.
 
Decided to do a series of tests to find out what's wrong.
1) Straight test to an empty application dummy for 9 hours
(passed, no reconnects);
2) Streaming to dummy which will transcode stream and pass it to dummy2 (3.8 hours passed);
<here I edited my static ip adress and seems like it fixed my issue>
3) Transcoded dummy2 passes stream back to my gaming machine's nginx to dummy3;
4) If (2) fails, dummy1 will pass straight stream to dummy2 without transcoding.

Streaming with nvenc and default settings at 50 mbit's. The stream is 30 seconds looped dreamscene video. I'll report on testing ending, but I'm curious of the results, since 9 hours test was flawless...

UPD: I edited my network configuration a bit (current state is at pastebin I linked earlier), and looks like those losses are gone.
Also I reduced FPS of ffmpeg from 60 to 50 to get extra clarity and get a bit easier on my CPU there.
 
Last edited:
Back
Top