Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Server specs recommendations #62

Closed
joaquin03 opened this issue Aug 19, 2020 · 3 comments
Closed

Question: Server specs recommendations #62

joaquin03 opened this issue Aug 19, 2020 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@joaquin03
Copy link

joaquin03 commented Aug 19, 2020

Hi grate project!

In my case, I have 200 cameras inside a firewall, and many users that want to consume the video, for small
periods (10s - 30s) but at the worst hours could be 30 - 50 different consumers at the same time. The video is small (640 x 360 - 6ftp)

  1. Is possible with "On-demand publishing" do this?

  2. With server specs do you recomend, for this use case?

Thanks!!

@aler9
Copy link
Member

aler9 commented Aug 25, 2020

Hello, at the moment sources are opened and closed with two different criteria:

  • when sourceOnDemand is off, sources are kept always opened - this is ideal for small bursts, for instance, i use the server in a project in which a series of ffmpeg instances connect to the server every 30 seconds to generate JPEG images, and then disconnect - i never got any problem
  • when sourceOnDemand is on, sources are closed immediately when there are no clients. This allows to save bandwidth, but is not ideal for clients that connect and disconnect ofter, since the server has to connect to the sources many times.

Therefore, an interesting enhancement could be the introduction of a parameter sourceDisconnectAfterSeconds, that tells the server to close the connection to a source only if there are no clients and a certain period has passed.

Regarding server specs, it's impossible to tell for certain, since performance depends on

  • source size and encoding (the source size is not enough to determine performance)
  • number of publishers
  • number of clients

I generally use a script to stress the test, something like this (publish something in /stream and change 40 with the number of readers you want to use):

#!/bin/sh -e

trap 'kill $(ps -o pid= --ppid $$)' INT

for i in $(seq 1 40); do
    ffmpeg -i rtsp://localhost:8554/stream -c copy -f mp4 -y /dev/null &
done

wait

and i measure CPU usage. After the measurement, you can size the server(s)

@aler9 aler9 added enhancement New feature or request question Further information is requested labels Aug 25, 2020
aler9 added a commit that referenced this issue Nov 1, 2020
… runOnDemandStartTimeout, runOnDemandCloseAfter (#62)
@aler9
Copy link
Member

aler9 commented Nov 2, 2020

new parameters have been added to better control the "on demand" feature (v0.12.0)

@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2023

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.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants