ossrs / oryx

Oryx(SRS Stack) is an all-in-one, out-of-the-box, and open-source video solution for creating online video services, including live streaming and WebRTC, on the cloud or through self-hosting.
https://ossrs.io/oryx
MIT License
519 stars 111 forks source link

Support external redis host and using 127.0.0.1 as default #196

Closed p4xx07 closed 3 months ago

p4xx07 commented 3 months ago

I want to use my external redis because after many hours of streaming and recording oryx stops working. There are many keys written that get cleaned only after you delete the recording task. I would like to be able to use my custom redis to support more intensive recordings

winlinvip commented 3 months ago

I believe this requirement is reasonable; thank you for submitting this Pull Request.

At the same time, I would like to discuss an issue with you: If we use an external Redis Server, should we support databases so that multiple Oryx instances can use the same Redis, isolating data through the DB parameter?

redis.NewClient(&redis.Options{Addr, Password, DB: 0})

If you think it's reasonable, then please add an environment variable REDIS_DATABASE, with the default value set to 0.

TRANS_BY_GPT4

p4xx07 commented 3 months ago

Ok I think we can do this. Let me make the changes

p4xx07 commented 3 months ago

@winlinvip let me know if we need to do more changes.

The issue I have been having is that if I record multiple streams for more than 10 hours with a docker with 4GB of ram, Oryx will start writing ts files in the wrong positions in the filesystem, so I'm guessing that redis gets filled up and oryx can't keep track of what he is supposed to do. Oryx will also stop working and won't come back up. If you have any thoughts on how to solve this it would be great. I'm hoping that outsourcing redis from the docker will fix this issue.

p4xx07 commented 3 months ago

I've also attempted to run this docker with my modifications, but I noticed even if I have my own redis setup, oryx will attempt to create it's own redis server. How should we face this issue? Do you have any ideas?

Allan-Nava commented 3 months ago

I've also attempted to run this docker with my modifications, but I noticed even if I have my own redis setup, oryx will attempt to create it's own redis server. How should we face this issue? Do you have any ideas?

Same problem

winlinvip commented 3 months ago

@winlinvip let me know if we need to do more changes.

The issue I have been having is that if I record multiple streams for more than 10 hours with a docker with 4GB of ram, Oryx will start writing ts files in the wrong positions in the filesystem, so I'm guessing that redis gets filled up and oryx can't keep track of what he is supposed to do. Oryx will also stop working and won't come back up. If you have any thoughts on how to solve this it would be great. I'm hoping that outsourcing redis from the docker will fix this issue.

This issue is not related to this pull request. Please submit a separate issue with detailed information about it.

TRANS_BY_GPT4

winlinvip commented 3 months ago

I've also attempted to run this docker with my modifications, but I noticed even if I have my own redis setup, oryx will attempt to create it's own redis server. How should we face this issue? Do you have any ideas?

This environment variable simply determines which Redis server Oryx connects to. However, Oryx will always create its own Redis server. This should not affect the final outcome, as it consumes very minimal resources and remains unused.

TRANS_BY_GPT4

p4xx07 commented 3 months ago

@winlinvip let me know if we need to do more changes. The issue I have been having is that if I record multiple streams for more than 10 hours with a docker with 4GB of ram, Oryx will start writing ts files in the wrong positions in the filesystem, so I'm guessing that redis gets filled up and oryx can't keep track of what he is supposed to do. Oryx will also stop working and won't come back up. If you have any thoughts on how to solve this it would be great. I'm hoping that outsourcing redis from the docker will fix this issue.

This issue is not related to this pull request. Please submit a separate issue with detailed information about it.

TRANS_BY_GPT4

I have created a seperate issue with screenshots detailing the issue. Thanks @winlinvip

https://github.com/ossrs/oryx/issues/197