Giter Site home page Giter Site logo

Comments (6)

edevil avatar edevil commented on May 22, 2024

Upon further investigation the asgi_redis module is using 5s timeouts on BLPOP messages, which should keep the connection healthy, however I've seen cases where the connection is dropped and the BLPOP response is never received. In this case the worker would wait forever. Using the socket_timeout option to the redis-py connection solves this issue, so I don't know if anything else is needed...

from channels_redis.

andrewgodwin avatar andrewgodwin commented on May 22, 2024

Yes, the pops are refreshed quite often, but the underlying socket connection is held open, and that might be what's dying. How did you add socket_timeout - is it something we should support?

from channels_redis.

edevil avatar edevil commented on May 22, 2024

In the layer config, I used a connection URL to configure a host. Here we can pass query parameters such as socket_timeout=10 to redis-py. I don't think anything else needs to be done since this is backend specific.

from channels_redis.

andrewgodwin avatar andrewgodwin commented on May 22, 2024

Alright, lovely! Hopefully someone else can find that info useful too.

from channels_redis.

edevil avatar edevil commented on May 22, 2024

I've been running more tests and, although the socket_timeout solves the issue of the worker waiting forever, it seems that being able to configure the socket_keepalive_options parameter of redis-py would be helpful. Otherwise when an idle connection is dropped there's still a noticeable lag while waiting for the timeout on the next call, whereas if the dropped connection was detected earlier the experience would be better.

from channels_redis.

andrewgodwin avatar andrewgodwin commented on May 22, 2024

Alright - do you want to open a new ticket with the details of what kind of configuration options would be useful? I have some time tomorrow I can use to work those in (it would be nice to expose socket_timeout more directly too, potentially, and document it)

from channels_redis.

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.