This application shows the difference between actioncable and anycable results in websocket programming.
- Anycable is better than actioncable when its comes to performance and memory allocation.
- Actioncable with iodine is better than actioncable in performance and memory allocation (but not good as anycable).
- Tsung is a load testing tool. It provides functionality to load the app with simultaneous user connection. It is developed in Erlang. Please gone through tsung.xml for input file.
- Actioncable 20k concurrent requests take 3.5 GB memory.
- Anycable 20k cocurrent requests take 800 MB memory.
Features | Actioncable | Anycable | Actioncable with Iodine |
---|---|---|---|
Compatibility | Compatible for Ruby >= 2.2.2 | Compatible for Ruby > 2.5 | Compatible for Ruby >= 2.2.2 |
Performance | 20k idle clients == 3.5 GB memory RAM usage | 20k idle clients == 800 MB memory RAM usage | 20k idle clients == 1.5 GB memory RAM usage |
Deployment | fayesocket as websocket server | anycable-go as websocket server | iodine as websocket server |
Simplicity of use | Easy to debug and use | we need to debug into gRPC server | |
Github link | https://github.com/rails/rails/tree/master/actioncable | https://github.com/anycable/anycable-rails | https://github.com/boazsegev/iodine |
RAILS_ENV=production bin/setup
RAILS_ENV=production bundle exec rails assets:precompile
curl -Lo bin/anycable-go https://github.com/anycable/anycable-go/releases/download/v0.6.0/anycable-go-v0.6.0-linux-amd64 && \
chmod +x bin/anycable-go
brew install tsung
.sudo cpan Template
.- For ubuntu please refer this link
ubuntu tsung
- To increase file limits refer this link
file-limits
- ActiveSupport::MessageEncryptor::InvalidMessage error
- Please remove config/master.key credentials.yml.enc
- Execute EDITOR="mate --wait" bin/rails credentials:edit
- Tsung is not working.
- Make sure you have set the limit of file descriptors as per your machine OS.
Foreman
is used in order to ease processes management with Procfiles.
foreman start -e .env.production,.env.actioncable -f Procfile.actioncable
foreman start -e .env.production,.env.anycable -f Procfile.anycable
foreman start -e .env.production,.env.actioncable_iodine -f Procfile.actioncable_iodine
tsung -f tsung.xml -k start
This will run runtime reporting on localhost:8091
- https://docs.anycable.io/v06/#/
- https://anycable.io/
- https://github.com/anycable/anycable-rails
- https://www.thegreatcodeadventure.com/load-testing-rails-5-action-cable-with-tsung/
- https://nebulab.it/blog/actioncable-vs-anycable-fight/
- https://www.youtube.com/watch?v=0cKtKxKzu68
- https://www.slideshare.net/TokyoIncidents/what-is-rack-hijacking-api-69807904
- https://github.com/boazsegev/iodine
- https://medium.com/@plezi_io/how-actioncable-broke-puma-fcfeceac33b0
- Make sure your socket connection is working with anycable(cable.yml).
- Benchmarking reporting is done with single threaded development machine It may vary in production.