bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
12.07k stars 1.52k forks source link

Linux Too many open files #740

Closed lucien-kejl closed 2 years ago

lucien-kejl commented 2 years ago

when i use in proxy mode, Linux amd64 standard, http api add 8 paths of proxy . os tells me many open files .

Which version are you using?

v0.17.9

Which operating system are you using?

Describe the issue

Description

Describe how to replicate the issue

  1. start the server
  2. publish with ...
  3. read with ...

Did you attach a network dump?

yes / no

lucien-kejl commented 2 years ago

can you explain a proxy will consume how many open files about?

mwvent commented 2 years ago

Woke up this morning to find cameras were not being proxied (to zoneminder and our CCTV monitor in the front room in our case). Only one single error in the logs marking the point it stopped working. Might be an issue with the latest version I have been running an older version with the same config for a long while without issue. I just upgraded to the latest version 128 hours before. If it happens again I will try and capture more information. I panic restarted the service this morning before thinking about testing what response (if any) was being given on the RTSP port.

@lucien-kejl seems to be a TCP/network issue not literal filesystem files.

journalctl --since "128 hours ago" -u rtsp-simple-server.service Dec 17 00:57:46 heimdall systemd[1]: Stopping Simple RTSP Server... Dec 17 00:57:46 heimdall systemd[1]: Stopped Simple RTSP Server. Dec 17 00:57:46 heimdall systemd[1]: Started Simple RTSP Server. Dec 22 04:01:51 heimdall nice[29810]: 2021/12/22 04:01:51 ERR [RTSP] accept tcp [::]:8554: accept4: too many open files Dec 22 06:46:32 heimdall systemd[1]: Stopping Simple RTSP Server... Dec 22 06:46:32 heimdall systemd[1]: Stopped Simple RTSP Server. Dec 22 06:46:32 heimdall systemd[1]: Started Simple RTSP Server.

Would like to take this opportunity to thank the author(s) of this software. It saves my poor little server so much CPU compared to any solutions I had before.

aler9 commented 2 years ago

Hello, the OS is responsible for limiting the number of opened file descriptors, the server can't do anything about it. Please tune the OS to increase the maximum number of file descriptors, there are plenty of tutorials about it.

lucien-kejl commented 2 years ago

@mwvent I think it is the problem of TCP/network ,but I start the server, it will happen after some hours . Have you come across this problem again?Do you solve it ?

mwvent commented 2 years ago

@mwvent I think it is the problem of TCP/network ,but I start the server, it will happen after some hours . Have you come across this problem again?Do you solve it ?

No have not had this issue since. Not made any changes either

github-actions[bot] commented 1 year ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.