Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rtmp_auto_push导致connect() to unix:/tmp/nginx-http-flv.1 failed (11: Resource temporarily unavailable) #268

Open
@alexKeleon

Description

When you meet a bug, please open the issue including a title prefixed by '[bug]' and describe it as follows:
(当你碰到一个 bug,请在提出问题时以 '[bug]' 为前缀写明标题,并且像下面的内容一样描述它):

Expected behavior (期望行为)

可以自动推流到多个worker

Actual behavior (实际行为)

worder只能等于1 才能正常工作

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

unbuntu 18.04
Nginx 1.16.1
NGINX_HTTP_FLV_MODULE_VERSION 1.2.6

Configuration file (配置文件)

nginx.conf

user nginx;
worker_processes auto;
#worker_cpu_affinity auto;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

load_module modules/ngx_http_flv_live_module.so;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

charset utf-8;
sendfile on;
keepalive_timeout 65;
client_max_body_size 32M;
gzip on;
gzip_comp_level 5;
gzip_min_length 10K;
gzip_proxied any;
gzip_vary on;
gzip_types application/atom+xml
 application/javascript
 application/json
 application/rss+xml
 application/vnd.ms-fontobject
 application/x-font-ttf
 application/x-web-app-manifest+json
 application/xhtml+xml
 application/xml
 font/opentype
 image/svg+xml
 image/x-icon
 text/css
 text/plain
 text/x-component;
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 /var/log/nginx/access.log main;
include /etc/nginx/conf.d/http/*.conf;

}

rtmp_auto_push on;
rtmp_auto_push_reconnect 1s;
rtmp_socket_dir /tmp;

rtmp {
out_queue 4096;
out_cork 512;
timeout 60s;
drop_idle_publisher 15s;

include /etc/nginx/conf.d/rtmp/*.conf;

}

对应的/etc/nginx/conf.d/http/http-flv.conf

server {
listen 80;
root /var/www;
charset utf-8;
access_log off;
error_log off;

location / {
 index index.html;
}
location /live {
 flv_live on;
 chunked_transfer_encoding on;
 add_header 'Access-Control-Allow-Origin' '*';
 add_header 'Access-Control-Allow-Credentials' 'true';
}
location /hls {
 types {
 application/vnd.apple.mpegurl m3u8;
 video/mp2t ts;
 }
 add_header 'Access-Control-Allow-Origin' '*';
 add_header 'Access-Control-Allow-Credentials' 'true';
 root /data/appdatas;
 add_header 'Cache-Control' 'no-cache';
}

}

对应的/etc/nginx/conf.d/rtmp/rtmp.conf
server {
listen 1935;

application hexie {
 live on;
 gop_cache on;
}

}

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

运行一段时间,就会出现

Error log if any (错误日志)

2024年08月01日 01:56:07 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.7 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:07 [error] 8#8: *58138 auto_push: connect failed: slot=1 pid=9 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:07 [error] 8#8: *58138 auto_push: connect failed: slot=2 pid=10 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:07 [error] 8#8: *58138 auto_push: connect failed: slot=3 pid=11 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:07 [error] 8#8: *58138 auto_push: connect failed: slot=4 pid=12 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:07 [error] 8#8: *58138 auto_push: connect failed: slot=5 pid=13 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:07 [error] 8#8: *58138 auto_push: connect failed: slot=6 pid=14 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:07 [error] 8#8: *58138 auto_push: connect failed: slot=7 pid=15 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:08 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.1 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:08 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.2 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:08 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.3 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:08 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.4 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:08 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.5 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:08 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.6 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:08 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.7 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:08 [error] 8#8: *58138 auto_push: connect failed: slot=1 pid=9 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:08 [error] 8#8: *58138 auto_push: connect failed: slot=2 pid=10 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:08 [error] 8#8: *58138 auto_push: connect failed: slot=3 pid=11 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:08 [error] 8#8: *58138 auto_push: connect failed: slot=4 pid=12 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:08 [error] 8#8: *58138 auto_push: connect failed: slot=5 pid=13 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:08 [error] 8#8: *58138 auto_push: connect failed: slot=6 pid=14 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:08 [error] 8#8: *58138 auto_push: connect failed: slot=7 pid=15 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:09 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.1 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:09 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.2 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:09 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.3 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:09 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.4 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:09 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.5 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:09 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.6 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:09 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.7 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:09 [error] 8#8: *58138 auto_push: connect failed: slot=1 pid=9 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:09 [error] 8#8: *58138 auto_push: connect failed: slot=2 pid=10 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:09 [error] 8#8: *58138 auto_push: connect failed: slot=3 pid=11 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:09 [error] 8#8: *58138 auto_push: connect failed: slot=4 pid=12 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:09 [error] 8#8: *58138 auto_push: connect failed: slot=5 pid=13 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:09 [error] 8#8: *58138 auto_push: connect failed: slot=6 pid=14 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:09 [error] 8#8: *58138 auto_push: connect failed: slot=7 pid=15 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:10 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.1 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:10 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.2 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:10 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.3 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:10 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.4 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:10 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.5 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:10 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.6 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:10 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.7 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:10 [error] 8#8: *58138 auto_push: connect failed: slot=1 pid=9 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:10 [error] 8#8: *58138 auto_push: connect failed: slot=2 pid=10 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:10 [error] 8#8: *58138 auto_push: connect failed: slot=3 pid=11 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:10 [error] 8#8: *58138 auto_push: connect failed: slot=4 pid=12 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:10 [error] 8#8: *58138 auto_push: connect failed: slot=5 pid=13 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:10 [error] 8#8: *58138 auto_push: connect failed: slot=6 pid=14 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:10 [error] 8#8: *58138 auto_push: connect failed: slot=7 pid=15 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:11 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.1 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:11 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.2 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:11 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.3 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:11 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.4 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:11 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.5 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:11 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.6 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:11 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.7 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:11 [error] 8#8: *58138 auto_push: connect failed: slot=1 pid=9 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:11 [error] 8#8: *58138 auto_push: connect failed: slot=2 pid=10 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:11 [error] 8#8: *58138 auto_push: connect failed: slot=3 pid=11 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:11 [error] 8#8: *58138 auto_push: connect failed: slot=4 pid=12 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:11 [error] 8#8: *58138 auto_push: connect failed: slot=5 pid=13 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:11 [error] 8#8: *58138 auto_push: connect failed: slot=6 pid=14 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:11 [error] 8#8: *58138 auto_push: connect failed: slot=7 pid=15 name='20250201020700040000', client: 172.18.1.25, server: 0.0.0.0:1935 2024年08月01日 01:56:12 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.1 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:12 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.2 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:12 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.3 failed (11: Resource temporarily unavailable) 2024年08月01日 01:56:12 [error] 8#8: connect() to unix:/tmp/nginx-http-flv.4 failed (11: Resource temporarily unavailable)

查看网络监控 netstat -apn 如下图

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /