Comments (14)
怎么复现?
你这图哪儿显示了内存占用14G?
from nginx-http-flv-module.
就只是用srs-bench并发推送很多路流。
from nginx-http-flv-module.
只推流没播放?
推流和nginx都运行在本机还是分离的?
from nginx-http-flv-module.
只是推流
推流和nginx是分离的。
from nginx-http-flv-module.
我按照你说的试了,暂时复现不出来,推100路流,内存一直稳定在224M左右
另外,你用的是release里1.2.4的包还是源代码编译的?
from nginx-http-flv-module.
用的是release里1.2.4包编译的。等一下我用最新代码编译试一下
from nginx-http-flv-module.
@luckywur 最新代码测试有问题么?
from nginx-http-flv-module.
`#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /live {
flv_live on;
chunked_transfer_encoding on; #open 'Transfer-Encoding: chunked' response
add_header 'Access-Control-Allow-Origin' '*'; #add additional HTTP header
add_header 'Access-Control-Allow-Credentials' 'true'; #add additional HTTP header
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root /var/www/rtmp;
}
location /control {
rtmp_control all;
}
}
}
rtmp_auto_push on;
rtmp_auto_push_reconnect 1s;
rtmp_socket_dir /tmp;
rtmp {
out_queue 4096;
out_cork 8;
max_streams 400;
server {
listen 1935;
application hls {
live on;
hls on;
hls_path /tmp/hls;
gop_cache on; #open GOP cache for reducing the wating time for the first picture of video
on_publish http://127.0.0.1:8080/nvrEvent/live/publish;
on_publish_done http://127.0.0.1:8080/nvrEvent/live/publishDone;
on_play http://127.0.0.1:8080/nvrEvent/live/play;
on_play_done http://127.0.0.1:8080/nvrEvent/live/playDone;
}
}
} `
这个是我的配置。目前测试方法是在on_play中调用其他应用进行推流,然后在on_play_done判断是否有其他用户,没有则停止推流,所以在测试的时候不停的推流、断开、再推流。
from nginx-http-flv-module.
发现疑似和hls有关系,我将配置的hls设置为off,内存占用才400M
from nginx-http-flv-module.
你用nginx-rtmp-module对比测试一下吧,hls部分的功能我没动过,如果有同样的问题,就不是nginx-http-flv-module的bug了
from nginx-http-flv-module.
发现在未开hls情况下,推流时间长了后,不停的停止推流再推流,内存会不断上涨。没有推流数据后内存仍然没有回收
from nginx-http-flv-module.
方便提供on_publish,on_publish_done,on_play和on_play_done的url内容么?
from nginx-http-flv-module.
代码有点多,
主要实现是on_play会判断该路流是否已经推送,推送了就直接返回ok,未推送则调用推送流程,返回ok
on_play_done是判断是否还有其他client在,如果没有则调用停止推送流程
on_publish则是简单的判断推送流的来源合法性
on_publish_done则是调用停止推送流程
目前测试的是通过解码器压力测试,同时播放90路左右的流,并发高的情况下,可能会存在不停的调用on_play、on_play_done
from nginx-http-flv-module.
那你自己调试吧
from nginx-http-flv-module.
Related Issues (20)
- A-V out of sync when restream HOT 1
- Error compiling v1.2.122 HOT 1
- Enhanced RTMP (AV1/VP9/HEVC support) HOT 4
- objs/lib/nginx-http-flv-module-1.2.11/hls/ngx_rtmp_mpegts_crc.c(81): fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "ngx_config.h"”? HOT 2
- Upgrade to nginx 1.24 auto_push causes looping signal 29 and signal 17 crash HOT 6
- Proxy Protocol Not Working HOT 2
- [bug] with stat info with multi config files HOT 6
- [bug] rtmp url stuck after a while HOT 6
- to big message error log HOT 4
- max_streams
- [bug] ffmpeg exiting after 9 seconds HOT 12
- variable 'nbufs' set but not used [-Werror,-Wunused-but-set-variable] HOT 4
- Why don't we provide a default compiled software package? HOT 2
- [question] http://example.com[:port]/dir/streamname.m3u8 unable to play HOT 4
- [bug] live: already publishing HOT 5
- ffmpeg [rtmp]: Cannot open connection tcp://127.0.0.1:1935?tcp_nodelay=0
- WriteN, RTMP send error 32(**bytes) HOT 2
- [bug] nginx reload causes lots of errors: 111: Connection refused and auto_push: connect failed in error log HOT 5
- unknown directive "rtmp" HOT 2
- Dynamic proxy pass HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-http-flv-module.