Giter VIP home page Giter VIP logo

Comments (9)

FZambia avatar FZambia commented on May 23, 2024

Hello, could you provide a bit more background on why do you need this? Is this for Kubernetes or smth similar?

Also do you need this per node or per full setup (i.e. switch to another Centrifugo setup on balancer for example)?

Not sure at moment which information I should provide to you as I don't understand what do you mean under node health in this moment.

from centrifuge.

flavianmissi avatar flavianmissi commented on May 23, 2024

Hey, yes of course.

Is this for Kubernetes or smth similar?

Exactly, I deployed centrifugo into multiple kubernetes clusters and I'm currently using the admin / endpoint as healthcheck, but it's not suitable for all my envs and it isn't a very trust worthy one either.

Also do you need this per node or per full setup (i.e. switch to another Centrifugo setup on balancer for example)?

I was envisioning something more like per container (so per node I suppose?), so if a container would for example lose access to redis for any reason, the healthcheck would start failling and kubernetes (or any other similar tool) could find this out via healthcheck then re-kick the problematic container.

Hope this is more clear now, thanks for the quick answer.

from centrifuge.

FZambia avatar FZambia commented on May 23, 2024

First idea is adding health status change here - this is a place where node tries to send information about itself to other nodes. This is done periodically and if this operation fails - engine is not working.

But this won't properly work in case when Redis sharding used at moment as we try to deliver Control message using each Redis shard in order, so actually some of them can return error.

Looks like if we want to check all shards this feature requires new Health method in engine which will return health status taking into account all shards and any engine specific things.

from centrifuge.

flavianmissi avatar flavianmissi commented on May 23, 2024

But this won't properly work in case when Redis sharding used at moment as we try to deliver Control message using each Redis shard in order, so actually some of them can return error.

Is this really something this healthcheck should be concerned about thought? On a cluster installation (a redis cluster in this case), node failures are acceptable as long as the whole cluster is still operational.

Looks like if we want to check all shards this feature requires new Health method in engine which will return health status taking into account all shards and any engine specific things.

Checking the health of each and every shard sounds like something redis should be doing, not centrifuge. There's even a command for that on redis-cli: redis-cli --cluster check 127.0.0.1:7000. I think an exposed ping (or health) method in the engine should be enough. Then the Node would expose a status check method.

Thoughts?

from centrifuge.

FZambia avatar FZambia commented on May 23, 2024

Is this really something this healthcheck should be concerned about thought? On a cluster installation (a redis cluster in this case), node failures are acceptable as long as the whole cluster is still operational.

Centrifuge uses application-level sharding (not Redis cluster). Because PUB/SUB does not scale well in Redis cluster - redis/redis#2672 and Redis mailing list. So we have to manually check each shard. Does it make sense?

Yep, the Node must have Health method too of course. Btw - look at related pr I opened recently - it waits for this method to be implemented in this lib.

from centrifuge.

flavianmissi avatar flavianmissi commented on May 23, 2024

Centrifuge uses application-level sharding (not Redis cluster). Because PUB/SUB does not scale well in Redis cluster - antirez/redis#2672 and Redis mailing list. So we have to manually check each shard. Does it make sense?

Oh that explains it, it does make sense, thank you.

Yep, the Node must have Health method too of course. Btw - look at related pr I opened recently - it waits for this method to be implemented in this lib.

Great news! I see the PR is merged now, do you have any kind of time line for when this should be generally available?

Thanks for making it happen btw 🎉

from centrifuge.

FZambia avatar FZambia commented on May 23, 2024

It's already available in Centrifugo v2.1.0 - but it just provides health endpoint without doing extra checks inside engine - i.e. here is a healthcheck handler. If you need more than that we still have to do this inside this lib first.

from centrifuge.

flavianmissi avatar flavianmissi commented on May 23, 2024

This satisfies my current needs, thank you!

from centrifuge.

FZambia avatar FZambia commented on May 23, 2024

OK, great! Will close this issue then because my current needs also satisfied with that simple health checker, if you will need more from it feel free to reopen!

from centrifuge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.