nginx rtmp-moduleで長時間配信を目指す ack_windowの調整 5

さらに懲りずにack_windowの調整をしてみる。
ack_window 500
よりか
ack_window 50

の方が微妙に改善している感じがするのでさらにack_windowサイズを小さくしてみる。
※単なる誤差範囲の気がするが、とことん検証してみる。

エンコーダ|⇒LAN⇒|nginx rtmp1| ⇒Internet⇒ |nginx rtmp2| ⇒|クライアント

という構成で、Pushで試験する。
注視しているのはrtmp1サーバ。切断されるか?

rtmp1はエンコーダからのデータを3つのサーバへpushするだけ
rtmp {
server {
listen 1935;

access_log logs/rtmp_access.log;

application live {
live on;
push rtmp://sakura.hoge.jp/live/test?user=live&pass=********;
push rtmp://video. hoge.jp/live/test?user=live&pass=********;
push rtmp://a.rtmp.youtube.com/live2/********;
}
}
}

rtmp2サーバは以下2つ どちらも同じack_windowサイズにし、インターネット回線経路での違いも確認する。

さくらのクラウドvmでack_windowを小さくしてみる。デフォルト5000000のところ1/1000000に設定。
rtmp {
server {
listen 1935;
ack_window 5;
buflen 30s;
drop_idle_publisher 5s;
publish_notify on;
notify_method get;

access_log logs/rtmp_access.log combined;

application live {
live on;
}
}

Cloudnでは、ack_windowを小さくしてみる。デフォルト5000000のところ1/1000000に設定。
rtmp {
server {
listen 1935;
buflen 30s;
publish_notify on;
drop_idle_publisher 5s;
ack_window 5;

access_log logs/rtmp_access.log combined;

application live {
live on;
on_publish http://localhost/publishauth/auth.php;
notify_method get;

on_play http://localhost:8080/on_play;
}
}

エンコーダ設定
ビットレート512kbps
キーフレーム2秒間隔
640×360
FPS20
音声ビットレート 128Kbps

2日間の記録
さくらのクラウド 7回切断
youtube 7回切断
Cloudn 4回切断

明らかにCloudnの方が調子いい。ただし、1日に2回は切れてしまう計算である。

切断時の生ログ
017/01/21 18:51:01 [info] 3183#0: *6 disconnect, client: sakura.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/21 18:51:01 [debug] 3183#0: *6 relay: play disconnect app=’live’ name=’test’
2017/01/21 16:13:29 [info] 3183#0: *2 disconnect, client: sakura.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/21 16:13:29 [debug] 3183#0: *2 relay: play disconnect app=’live’ name=’test’
2017/01/21 16:13:29 [debug] 3183#0: *2 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/21 17:50:41 [info] 3183#0: *5 disconnect, client: sakura.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/21 17:50:41 [debug] 3183#0: *5 relay: play disconnect app=’live’ name=’test’
2017/01/21 17:50:41 [debug] 3183#0: *5 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/21 18:17:34 [info] 3183#0: *3 disconnect, client: video.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/21 18:17:34 [debug] 3183#0: *3 relay: play disconnect app=’live’ name=’test’
2017/01/21 18:17:34 [debug] 3183#0: *3 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/21 18:51:01 [debug] 3183#0: *6 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/21 22:04:02 [info] 3183#0: *4 disconnect, client: a.rtmp.youtube.com/live2/*********, server: ngx-relay
2017/01/21 22:04:02 [debug] 3183#0: *4 relay: play disconnect app=’live2′ name=’test’
2017/01/21 22:04:02 [debug] 3183#0: *4 relay: play left after disconnect app=’live2′ name=’test’: 2
2017/01/21 23:16:32 [info] 3183#0: *7 disconnect, client: video.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/21 23:16:32 [debug] 3183#0: *7 relay: play disconnect app=’live’ name=’test’
2017/01/21 23:16:32 [debug] 3183#0: *7 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/22 01:36:25 [info] 3183#0: *8 disconnect, client: sakura.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/22 01:36:25 [debug] 3183#0: *8 relay: play disconnect app=’live’ name=’test’
2017/01/22 01:36:25 [debug] 3183#0: *8 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/22 04:55:05 [info] 3183#0: *9 disconnect, client: a.rtmp.youtube.com/live2/*********, server: ngx-relay
2017/01/22 04:55:05 [debug] 3183#0: *9 relay: play disconnect app=’live2′ name=’test’
2017/01/22 04:55:05 [debug] 3183#0: *9 relay: play left after disconnect app=’live2′ name=’test’: 2
2017/01/22 08:19:48 [info] 3183#0: *12 disconnect, client: a.rtmp.youtube.com/live2/*********, server: ngx-relay
2017/01/22 08:19:48 [debug] 3183#0: *12 relay: play disconnect app=’live2′ name=’test’
2017/01/22 08:19:48 [debug] 3183#0: *12 relay: play left after disconnect app=’live2′ name=’test’: 2
2017/01/22 08:39:56 [info] 3183#0: *10 disconnect, client: video.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/22 08:39:56 [debug] 3183#0: *10 relay: play disconnect app=’live’ name=’test’
2017/01/22 08:39:56 [debug] 3183#0: *10 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/22 10:07:16 [info] 3183#0: *13 disconnect, client: a.rtmp.youtube.com/live2/*********, server: ngx-relay
2017/01/22 10:07:16 [debug] 3183#0: *13 relay: play disconnect app=’live2′ name=’test’
2017/01/22 10:07:16 [debug] 3183#0: *13 relay: play left after disconnect app=’live2′ name=’test’: 2
2017/01/22 10:49:57 [info] 3183#0: *11 disconnect, client: sakura.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/22 10:49:57 [debug] 3183#0: *11 relay: play disconnect app=’live’ name=’test’
2017/01/22 10:49:57 [debug] 3183#0: *11 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/22 16:16:21 [info] 3183#0: *16 disconnect, client: sakura.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/22 16:16:21 [debug] 3183#0: *16 relay: play disconnect app=’live’ name=’test’
2017/01/22 16:16:21 [debug] 3183#0: *16 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/22 17:12:56 [info] 3183#0: *15 disconnect, client: a.rtmp.youtube.com/live2/*********, server: ngx-relay
2017/01/22 17:12:56 [debug] 3183#0: *15 relay: play disconnect app=’live2′ name=’test’
2017/01/22 17:12:56 [debug] 3183#0: *15 relay: play left after disconnect app=’live2′ name=’test’: 2
2017/01/22 21:08:52 [info] 3183#0: *14 disconnect, client: video.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/22 21:08:52 [debug] 3183#0: *14 relay: play disconnect app=’live’ name=’test’
2017/01/22 21:08:52 [debug] 3183#0: *14 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/22 23:04:26 [info] 3183#0: *18 disconnect, client: a.rtmp.youtube.com/live2/*********, server: ngx-relay
2017/01/22 23:04:26 [debug] 3183#0: *18 relay: play disconnect app=’live2′ name=’test’
2017/01/22 23:04:26 [debug] 3183#0: *18 relay: play left after disconnect app=’live2′ name=’test’: 2
2017/01/23 00:40:59 [info] 3183#0: *17 disconnect, client: sakura.hanako.jp/live/test?user=live&pass=*********, server: ngx-relay
2017/01/23 00:40:59 [debug] 3183#0: *17 relay: play disconnect app=’live’ name=’test’
2017/01/23 00:40:59 [debug] 3183#0: *17 relay: play left after disconnect app=’live’ name=’test’: 2
2017/01/23 01:35:16 [info] 3183#0: *20 disconnect, client: a.rtmp.youtube.com/live2/*********, server: ngx-relay
2017/01/23 01:35:16 [debug] 3183#0: *20 relay: play disconnect app=’live2′ name=’test’