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

[Question] Any existing issues with Disk I/O and this module? #232

Closed jyelloz closed 1 year ago

jyelloz commented 1 year ago

Hi, I am working on a project that relies on this module to accept input RTMP streams and forward them elsewhere on a local network. Lately, a problem has been identified where occasionally some live streams perform poorly, specifically viewers will experience higher than normal lag and unstable framerates after the stream has been running for a few hours. Observing the host, one can see increased disk I/O around the time when the performance degrades, though the system CPU or memory usage does not change significantly during this time. Nginx is the only significant process running on the host. A few possibilities have been considered as the cause. First, the server is currently configured to write its access log to stdout. Second, the server is configured with HLS enabled which writes to the disk during streaming. Aside from those two, which have been explicitly configured and can be easily changed, are there any other scenarios where this module will write to disk while relaying an RTMP stream?

Thanks.

winshining commented 1 year ago

Hello! If error_log and access_log directives were set properly in the configuration file, writing to access.log and error.log would not be the bottleneck. Receiving and relaying RTMP streams only affect CPU and memory but not disk I/O. Maybe writing to/reading from .ts increased disk I/O.

More information is needed to find the reason.

jyelloz commented 1 year ago

Thanks for the quick response.

I also looked into the code recently and couldn't find anything other than what was mentioned so most likely the cause of the problem isn't in the module.