anycable / simple-cable-app

Minimal ActionCable/AnyCable application which could be deployed on Heroku
1 stars 2 forks source link

Simple Cable

Minimal ActionCable/AnyCable application which could be deployed on Heroku and also a playground for performance experiments.

Deployment

# Create app
heroku create simple-cable-app

# We need Redis for pub/sub
heroku addons:create heroku-redis

# Configure buildpacks
heroku buildpacks:add https://github.com/anycable/heroku-anycable-go
heroku buildpacks:add heroku/ruby

heroku config:set ANYCABLE_DEPLOYMENT=true

# (optionally) Use anycable-go with mruby support
# and log stats in Librato format
heroku config:set HEROKU_ANYCABLE_GO_VERSION=0.6.4-mrb
heroku config:set ANYCABLE_METRICS_LOG_FORMATTER=etc/anycable_librato_logger.rb

git push heroku master

Integration Tests

You can use wsdirector to verify your deployment:

wsdirector features/broadcast.yml wss://simple-cable-app.herokuapp.com/cable -s 10

See features/ folder for available scenarios.

Benchmarking/testing

Use websocket-bench for stress testing. For example, to run broadcast scenario you use the predefined options:

cat benchmarks/broadcast.opts | xargs websocket-bench broadcast
...

Use ACLI to connect to Action Cable server from your terminal.

Heap capturing