日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

nginx-rtmp 之统计在线clients

發布時間:2024/2/28 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 nginx-rtmp 之统计在线clients 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1. 使用Statistics 模塊中的以下兩個命令來實現統計在線人數的功能

  • rtmp_stat
    • rtmp_stat_stylesheet
# HTTP can be used for accessing RTMP statshttp {server {listen 8080;# This URL provides RTMP statistics in XMLlocation /stat {rtmp_stat all;# Use this stylesheet to view XML as web page# in browserrtmp_stat_stylesheet stat.xsl;}location /stat.xsl {# XML stylesheet to view RTMP stats.# Copy stat.xsl wherever you want# and put the full directory path hereroot /path/to/stat.xsl/;}}

2. 但是ngx_rtmp_stat_module 不支持多進程。這個問題通過這個補丁per-worker-listener優化。

步驟:

1. 克隆per-worker-listener : https://github.com/arut/nginx-patches.git?到nginx 目錄下面

2. 打補丁

root@ubuntu2004:/media/code/kaiyuan/openresty-1.19.9.1/bundle/nginx-1.19.9# patch -p1 < per-worker-listener?

root@ubuntu2004:/media/code/kaiyuan/openresty-1.19.9.1/bundle/nginx-1.19.9# patch -p1 < nginx-patches/per-worker-listener patching file src/core/ngx_connection.c Hunk #2 succeeded at 414 (offset 102 lines). Hunk #3 succeeded at 486 (offset 142 lines). Hunk #4 succeeded at 657 with fuzz 1 (offset 190 lines). patching file src/core/ngx_connection.h Hunk #1 succeeded at 57 (offset 3 lines). patching file src/http/ngx_http.c Hunk #1 succeeded at 1769 with fuzz 1 (offset -48 lines). patching file src/http/ngx_http_core_module.c Hunk #1 succeeded at 3920 (offset -106 lines). patching file src/http/ngx_http_core_module.h Hunk #1 FAILED at 72. 1 out of 1 hunk FAILED -- saving rejects to file src/http/ngx_http_core_module.h.rej patching file src/os/unix/ngx_process.c patching file src/os/unix/ngx_process.h Hunk #1 succeeded at 85 (offset 2 lines). patching file src/os/unix/ngx_process_cycle.c Hunk #1 succeeded at 764 with fuzz 2 (offset 27 lines). Hunk #2 FAILED at 972. 1 out of 2 hunks FAILED -- saving rejects to file src/os/unix/ngx_process_cycle.c.rej

3?make &make install

總結

以上是生活随笔為你收集整理的nginx-rtmp 之统计在线clients的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。