-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add pullRegion to streams to make the ingest node sticky #2127
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -712,6 +713,28 @@ describe("controllers/stream", () => { | |||
const document = await db.stream.get(stream.id); | |||
expect(db.stream.addDefaultFields(document)).toEqual(updatedStream); | |||
}); | |||
it("should extract region from redirected playback url", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to have some flv urls in here to verify nothing breaks:
e.g /flv/<playback-id>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As pointed out below, we don't use it for /flv
return null; | ||
} | ||
const url = new URL( | ||
pathJoin(ingest, `hls`, "not-used-playback", `index.m3u8`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need to handle flv as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this call is not for the "any redirect", this is just to discover which should be the ingest node.
So, kind-of hack the system and use catalyst-api redirect balancing (effectively using MistUtilLoad
) to divide on the ingest node.
This is the updated flow:
stream.pull.location
)stream.pullRegion
This way, we resolve region once in
/pull
and then re-use the same region for stream pulling. This should make some improvement in the ingest node, and what's even better, we can start logging that(lat,lon)=>region
, and then have data to say if out method for choosing ingest node (MistUtilLoad
) is correct.One of the further idea would be to not use
MistUtilLoad
, but just always use the geographically closest node.Related PRs: