Streams distribution

The Luna-Video-Manager service distributes streams provided by users to agents in the following way:

For not splittable streams:

  • select all streams that required processing (the only streams with pending status assume processing, for more information about streams statuses see streams statuses chapter)

  • select all available agents (for more information about agents interaction see agents interaction chapter) which current streams processing number does not reach the maximum number of streams available to it for simultaneous processing for agent

  • in order of time the streams were created select an agent for each stream satisfying the following conditions:

    For not splittable streams

    • agent can process analytics specified for stream

    • there is free slot for stream (agent provides max_stream_count - maximum number of streams available to it for simultaneous processing, so the number of simultaneous streams for agent cannot exceed this number)

    For splittable streams (calculates for each stream analytic which processing is in pending)

    • agent can process one or more analytics specified for stream

    • there is free slot for stream

  • makes necessary records in database to reply to agent request according to previous logic

  • agent receives streams via stream request - streams that need to be processed. The stream once mentioned in response to the request, it will no longer be mentioned in responses to this request.

  • agent make feedback requests and receive responses which will contain which contain information what agent must do with streams - continue processing or stop processing.

Note

Splittable streams feedbacks and other logic works in the same way for each part of splittable stream as for not splittable stream.

The described procedure will be executed as periodical background task of master instance. The period of execution can be configured using LUNA_VIDEO_MANAGER_STREAMS_AGENT_SEARCH_INTERVAL setting. It is highly not recommended to change this value without understanding the consequences.