How jibri servers are selected?

I have been looking an answer to this and still not able to find an answer.
How jitsi select the “next” jibri server available?

I have an enviroment with a jitsi server and 4 additional jibri servers, lets call JIBRI 1, 2, 3, 4… and mostly of the times the JIBRI 1 is requested.

Is there an algorithm who select the server, or any rule like a queue, a round-robin selection or something like this?

Does anyone have as idea? At least where i could find this answer

It seemed to me that the first available one is selected according to the order of registration.
But I didn’t see the code.

1 Like

The Jibris all join an XMPP MUC, and when a request comes in Jicofo looks for one which is available–I don’t know if there’s any distinct order in which they get traversed.

1 Like

Thanks for the comments guys.

Any idea how could i make a queue or something like to balance the jibri servers usage?

What are you trying to balance? Each Jibri can only do one session at a time.

Maybe balance was not the right word to explain

Im trying to distribute the jibri usage among my servers. I have 4 of them, but if i have 1 recording after another, they are going for the “jibri 1” server mostly of the times.
Id like to do a queue and after the jibri1 was called, goes to the end and rotate the server usage.

But, why? Is there a reason you want to distinguish a Jibri which is available, but had a session in the last X minutes vs a Jibri that is available, but had a session X + 5 minutes ago, for example? All ‘available’ Jibris should be equivalent.

Im worried about my disk usage :smiley:

If im able to distribute will give me more time and management options.

Ok, well a Jibri is not considered “available” until it’s done with the last session, which includes the execution of the finalize script (which is the hook for handling recorded files) so if you upload the file as part of that and delete it on the Jibri itself, that’ll mitigate this. But, there’s currently no feature like the one you’re asking for to use Jibris in that way.

Well, Thank you very much bbaldino.
Im doing exactly this, my finalize script does the job but i was looking for options.

Hello @Lissandro,

I made some tests and my assumption seems true. If the Jibri service is restarted after each recording, the Jibri client is registered again and it goes to the end of the queue. So the next client in the queue is started for the next recording.

I did the same here emrah, i found the same. Thanks for the sharing your tests :smiley:

1 Like