1
0
Fork 0
forked from External/mediamtx

try to raise the number of file descriptors that can be opened to remove limits on number of connected clients (#193)

This commit is contained in:
aler9 2021-03-19 13:37:14 +01:00
parent d40a8bb144
commit fb0e900eb5
3 changed files with 42 additions and 0 deletions

View file

@ -16,6 +16,7 @@ import (
"github.com/aler9/rtsp-simple-server/internal/metrics"
"github.com/aler9/rtsp-simple-server/internal/pathman"
"github.com/aler9/rtsp-simple-server/internal/pprof"
"github.com/aler9/rtsp-simple-server/internal/rlimit"
"github.com/aler9/rtsp-simple-server/internal/serverrtmp"
"github.com/aler9/rtsp-simple-server/internal/serverrtsp"
"github.com/aler9/rtsp-simple-server/internal/stats"
@ -56,6 +57,11 @@ func newProgram(args []string) (*program, bool) {
os.Exit(0)
}
// on Linux, try to raise the number of file descriptors that can be opened
// to allow the maximum possible number of clients
// do not check for errors
rlimit.Raise()
p := &program{
confPath: *argConfPath,
terminate: make(chan struct{}),