Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Juan Trejo
    @trejo08
    hey guys
    I have an issue trying to setup anycable inside a kubernetes cluster
    Vladimir Dementyev
    @palkan
    Hi Juan! It would be great if you clarify the problem)
    Conan Jen
    @conanjen
    hello, i was wondering if there was any documentation around scaling the anycable-rails side of things (specifically the rpc server that's run via bundle exec anycable ...)? for context, i've been attempting to load test our current setup in heroku (one anycable dyno running bundle exec anycable --server-command="anycable-go", and one web server just running the normal rails server via puma) and once we hit about 2k connections we start to run into a situation where the actioncable server side of things cannot serve the /cable endpoint quickly enough (the initial requests to /cable don't receive a response). is there something i'm missing since it seems like this should not be remotely anywhere close to load that would cause the rpc server to fail
    16 replies
    Vladimir Dementyev
    @palkan
    Increasing concurrency (at both ends, RPC and Go) is the only way (not considering adding more instances); what about your DB pool size? Did you increase it accordingly?
    The only way to deal with the thundering herd problem is to introduce a random backoff during reconnection (btw, this feature will be in Rails 7 out-of-the-box)
    Conan Jen
    @conanjen
    yeah, we increased the db pool size accordingly as well (i assume the rpc worker pool at most will take one db connection per worker so right now the db pool == rpc pool size, and rpc concurrency is slightly lower than both)
    Conan Jen
    @conanjen
    is there any more settings / logging options that would enable me to see in more detail what might potentially be causing the RPC congestion?
    3 replies
    Vitaliy A
    @croatech
    hey guys
    any ideas why rails view is trying to connect to app:3000/cable by default? it's overrode in development.rb and production.rb config.action_cable.url = "ws://anycable-go:#{ENV['ANYCABLE_PORT']}/cable"
    Снимок экрана 2021-04-21 в 15.27.57.png
    Vladimir Dementyev
    @palkan
    Do you have action_cable_meta_tag included in the view (usually, layout)?
    1 reply
    Vladimir Dementyev
    @palkan
    Interesting, that it uses 0.0.0.0:3000 🤔 could you trace the place in JS where consumer is initialized? (Try Initiator tab in Chrome DevTools)
    Bartosz Gaj
    @bgaj

    Hi. I have a problem with docker configuration on production enviroment. I based on https://github.com/anycable/anycable_rails_demo/blob/master/docker-compose.yml and same config on my local machine is working but on other i get 2021-04-28T22:40:01.716Z context=ws Websocket session initialization failed: rpc error: code = Unavailable desc = last connection error: connection error: desc = "transport: Error while dialing dial tcp 172.30.0.7:50051: connect: connection refused. 172.30.0.7 is docker container address with rpc. I also checked rpc healt and i get 200, and these are mine enviroments

    ANYCABLE_RPC_HOST=rpc:50051
    ANYCABLE_HOST=0.0.0.0
    ACTION_CABLE_ADAPTER=any_cable
    ANYCABLE_DEBUG=1
    ANYCABLE_REDIS_URL=redis://redis:6379/1
    ANYCABLE_HEADERS=cookie,origin

    and docker-compsose with anycable-go and rpc

    anycable:
        image: 'anycable/anycable-go:1.0'
        restart: always
        depends_on:
          redis:
            condition: service_healthy
        ports:
          - '90:8080'
        env_file:
          - .env
      rpc:
        build: .
        command: bash -c "bundle exec anycable"
        restart: always
        depends_on:
          anycable:
            condition: service_started
        volumes:
          - bundle:/bundle
          - ${APP_VOLUME}
        env_file:
          - .env
    2 replies
    rafali
    @rafaqat
    Reaching out to IOS devs - what libraries are people using on IOS with AnyCable
    Vladimir Dementyev
    @palkan
    rafali
    @rafaqat
    its swift3
    have you have a fork that works
    Duc Thien
    @ducthien1490
    Hi all, I'm trying to run check health of container from anycable/anycable-go but it return nothing (curl: (52) Empty reply from server)
    $ docker run --ulimit nofile=65536:65536 -p 8080:8080 -e "REDIS_URL=redis://docker.for.mac.host.internal:6379/0" -e "ANYCABLE_RPC_HOST=rpc:50051" anycable/anycable-go:latest
    I 2021-05-12T10:56:44.061Z context=main Starting AnyCable 1.0.5-2b1cbd6 (pid: 1, open file limit: 65536)
    I 2021-05-12T10:56:44.061Z context=main Handle WebSocket connections at http://localhost:8080/cable
    I 2021-05-12T10:56:44.062Z context=main Handle health connections at http://localhost:8080/health
    I 2021-05-12T10:56:44.063Z context=rpc RPC controller initialized: rpc:50051 (concurrency: 28, proto_versions: v0,v1)
    I 2021-05-12T10:56:44.066Z context=pubsub Subscribed to Redis channel: __anycable__
    $ curl -v http://localhost:8080/health
    *   Trying ::1...
    * TCP_NODELAY set
    * Connected to localhost (::1) port 8080 (#0)
    > GET /health HTTP/1.1
    > Host: localhost:8080
    > User-Agent: curl/7.64.1
    > Accept: */*
    >
    * Empty reply from server
    * Connection #0 to host localhost left intact
    curl: (52) Empty reply from server
    * Closing connection 0
    Did I miss any configurations?
    Vladimir Dementyev
    @palkan
    Hi! Your server is not available to the outer world, add ANYCABLE_HOST=0.0.0.0 (or --host=0.0.0.0)
    Duc Thien
    @ducthien1490
    Thanks Valimidr, it's working now
    Vladimir Dementyev
    @palkan

    We're preparing the v1.1 release; the first candidate is out, please, check it out!

    https://twitter.com/any_cable/status/1392528999402856449

    arpansac
    @arpansac
    Does doing Rails_env=production make any difference in anycable-rails performance?
    5 replies
    And how can debug, it's taking up too much memory just for 50 people live with anycable
    6 replies
    Duc Thien
    @ducthien1490
    Hi again, does anyone has experience with AWS ALB? We can talk withanycable-rails inside VPC but unable to connect through ALB(port 443) and target group (listen on port 50051 enable grpc, http)
    15 replies
    Duc Thien
    @ducthien1490
    Seems AWS HTTP/HTTPS ALB cannot forward gRPC to target group
    I changed to use network LB and it works flawlessly
    arpansac
    @arpansac

    How check what's the max limit for a 1CPU 2GB RAM server with the following
    Total channels: 13
    Total Users: 50

    If each user is subscribed to each channel: 50x13= 650 connections
    Even if there are approx 50 different streams for each channel to which different or all users are listening (example each 'vote' component is realtime for each message in the chat): 650x50=32500

    But I think the information of these streams are maintained in redis (not in memory), am I correct?

    How many machines might be needed?

    17 replies
    Francis Sinson
    @franee_gitlab

    Hi all, is there a specific reason why ActionCable.server.config.url is explicitly set on the demo app? https://github.com/anycable/anycable_rails_demo/blob/master/config/environments/development.rb#L6

    But in the docs (https://docs.anycable.io/#/v1/rails/getting_started) it doesn't say anything about that. Thanks!

    4 replies
    Phlegx Systems OG
    @phlegx

    Hi! I use the latest anycable version with Rails. In my anycable.yml config file I set redis_url and redis_sentinels but when I call AccountChannel.broadcast_to(...) I get Redis::CommandError (NOAUTH Authentication required.). Here my config:

    development:
      ...
      redis_url: 'redis://:my_pass@anycable_master:6379/0'
      redis_sentinels: ':my_pass@sentinel_one:26379'

    What I'm doing wrong?

    1 reply
    Phlegx Systems OG
    @phlegx
    development:
      ...
      redis_url: 'redis://:my_pass@anycable_master:6379/0'
      redis_sentinels: ':my_pass@sentinel_one:26379,:my_pass@sentinel_two:26379'
    matedemorphy
    @matedemorphy
    is there some configuration that needs to be done when using Vagrant?
    Vladimir Dementyev
    @palkan
    Anil Kumar Maurya
    @anilmaurya
    Screenshot 2021-06-02 at 8.21.33 PM.png

    Hi @palkan
    Thank you for Anycable

    I am struggling in running cable in production mode. Its working fine in development mode but just hangs when I start with RAILS_ENV=production

    I upgraded to latest version of anycable-rails but problem is not resolved.

    Screenshot 2021-06-02 at 8.22.40 PM.png
    Vladimir Dementyev
    @palkan
    Hey! Why do you think it hangs? It’s likely operating normally but not printings logs to the console (which is enabled only in development)
    CameloHQ
    @CameloHq_twitter
    Anyone know how to do interactive debug if anycable is being run through docker-compose and DIP. dip up anycable? I put byebug in the codebase and it does not stop for prompting as similar in Rails server (that running via docker as well).
    To clarify, it's Anycable RPC.
    CameloHQ
    @CameloHq_twitter
    For anyone who has the same issue, it's docker-related thing. Try "docker attach [container-id]", and things will work.
    Vladimir Dementyev
    @palkan

    You can add a custom Dip command to enable debugging capabilities: https://github.com/anycable/anycable_rails_demo/blob/c0b8ad885ddbe67209d0bb78cd661ac53ce81cbb/dip.yml#L44-L47

    And then you run AnyCable as dip anycable.

    Hemant Bhanoo
    @hbhanoo
    Hi guys. I've been running anycable for a small realtime application. I notice that some of my users who join on their phones (ie. possibly high latency, low bandwidth) 'leave' and 'rejoin' my channels. I'm assuming there's some latency or missed-packet threshhold that they're using that makes them drop and then reconnect. Does anyone know if/how it's possible to tune this?
    Vladimir Dementyev
    @palkan

    Hey! Looks like a reconnection feature of the Action Cable JS client: it assumes that a ping from server is received every 3s; if not it reconnects.
    There is no way to change this interval in JS client.
    You can try to tune the ping interval at the server side (make it smaller).

    also, make sure you're using the latest version of AnyCable-go (at least 1.0.5)

    2 replies
    Subramanian-ERS
    @Subramanian-ERS

    Hello Team,
    I would like to connect anycable in my Rails application to my Redis cluster hosted on AWS. When I wanted anycable to connect to a single Redis instance, I used the below configuration:
    development:
    redis_url: <Redis instance URL>

    Would it be enough if I just replace the instance URL with the cluster URL? Will anycable have the intelligence to gather the multiple nodes in the cluster and connect to them all?

    Vladimir Dementyev
    @palkan
    Hi!
    Redis Cluster is currently not supported. That doesn't make a lot of sense in using a cluster for AnyCable, since we only use pub/sub (currently). So, I'd recommend launching a standalone Redis instance for that.
    9 replies
    Fodil Youssouf Islam
    @fodil-youssouf-islam
    Holla everyone,
    Hope you all doing well, I just wanna say thank you for your work and contribution to the open-source and ruby community, may God bless you all.
    also, I wanna share my experience deploying and using anycable, I had an issue deploying it at heroku (great doc by the way) saying "AnyCable server builder must be configured. Make sure you've required a gem (e.g. grpc) or configured AnyCable.server_builder yourself" and to resolve it I had to add grpc gem to my gemfile which is not needed in other production deployments and locally .
    Vladimir Dementyev
    @palkan

    Thank you!

    Yeah, since v1.1 grpc has been declared as an optional dependency; but Ruby doesn’t have such mechanism 🙂

    We should think about how to make it easier to figure this out 🤔