winshining / nginx-http-flv-module

A media streaming server based on nginx-rtmp-module. In addtion to the features nginx-rtmp-module provides, HTTP-FLV, GOP cache, VHosts (one IP for multi domain names) and JSON style statistics are supported now.
BSD 2-Clause "Simplified" License
2.71k stars 567 forks source link

to big message error log #242

Closed streamingsystems closed 9 months ago

streamingsystems commented 11 months ago

We have been getting complaints from one our customers that at certain times when they switch scenes in their encoder our system will disconnect them. I turned on debug today and was able to reproduce it.

Essentially if they switch from an all black screen to a very action packed screen they get disconnected. They are sending 1080.

In the error log I see:

2023/07/19 13:31:50 [debug] 2007562#2007562: 178 RTMP send nmsg=1, priority=0 #1498 2023/07/19 13:31:50 [debug] 2007562#2007562: 178 event timer del: 26: 648889710 2023/07/19 13:31:50 [debug] 2007562#2007562: 178 event timer add: 26: 10000:648889710 2023/07/19 13:31:50 [debug] 2007562#2007562: 173 live: rel audio packet delta=21 2023/07/19 13:31:50 [debug] 2007562#2007562: 173 RTMP send nmsg=1, priority=0 #2224 2023/07/19 13:31:50 [debug] 2007562#2007562: 173 event timer del: 3: 648889710 2023/07/19 13:31:50 [debug] 2007562#2007562: 173 event timer add: 3: 10000:648889710 2023/07/19 13:31:50 [debug] 2007562#2007562: 174 calling handler 4 2023/07/19 13:31:50 [debug] 2007562#2007562: 174 calling handler 5 2023/07/19 13:31:50 [debug] 2007562#2007562: 174 RTMP bheader fmt=1 csid=6 2023/07/19 13:31:50 [debug] 2007562#2007562: *174 RTMP mheader fmt=1 video (9) time=82033+34 mlen=1425259 len=0 msid=1 2023/07/19 13:31:50 [info] 2007562#2007562: 174 too big message: 1425259, 1048576, client: , server: 0.0.0.0:1935 2023/07/19 13:31:50 [debug] 2007562#2007562: 174 finalize session 2023/07/19 13:31:50 [debug] 2007562#2007562: 174 post event 0000559F00C753C8 2023/07/19 13:31:50 [debug] 2007562#2007562: 174 close session 2023/07/19 13:31:50 [info] 2007562#2007562: *174 disconnect, client: *, server: 0.0.0.0:1935 2023/07/19 13:31:50 [info] 2007562#2007562: 174 deleteStream, client: , server: 0.0.0.0:1935 2023/07/19 13:31:50 [info] 2007562#2007562: *174 notify: publish_done '127.0.0.1:80/publishdone', client: **, server: 0.0.0.0:1935

As you can see it says "too big message" and then disconnects.

It might not be a "bug" per se, but rather it's hitting some type of message limit or buffer size is being exceeded.

Do you by chance know how to solve this?

Expected behavior (期望行为)

It should not disconnect.

Actual behavior (实际行为)

OS and Nginx version (操作系统和 Nginx 版本号)

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful [root@ingest-staging nginx]# /usr/local/nginx/sbin/nginx -V bash: /usr/local/nginx/sbin/nginx: No such file or directory [root@ingest-staging nginx]# nginx version: nginx/1.24.0 nginx: invalid option: "version:" [root@ingest-staging nginx]# /usr/local/nginx/sbin/nginx -V nginx version: nginx/1.24.0bash: /usr/local/nginx/sbin/nginx: No such file or directory [root@ingest-staging nginx]# nginx version: nginx/1.24.0 nginx: invalid option: "version:" [root@ingest-staging nginx]# nginx -V nginx version: nginx/1.24.0 built by gcc 8.5.0 20210514 (Red Hat 8.5.0-16) (GCC) built with OpenSSL 1.1.1k FIPS 25 Mar 2021 TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-openssl-opt=enable-ktls --with-cc-opt='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

Configuration file (配置文件)

Steps to reproduce the behavior (复现问题步骤)

Error log if any (错误日志)

streamingsystems commented 11 months ago

I found the setting.

shirley-sunxp commented 11 months ago

I found the setting. I have the same problem. could you please tell me where is the setting

streamingsystems commented 11 months ago

Directivesgithub.comThe default (when not in the config) for max_message is 1M. I added to the config:max_message 2M;And it worked great. Let me know if you need anything else. On Jul 21, 2023, at 2:09 AM, sunxp @.***> wrote:

I found the setting. I have the same problem. could you please tell me where is the setting

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

winshining commented 9 months ago

It seems it was resolved, close it now.