0% found this document useful (0 votes)
18 views28 pages

AnyCable vs ActionCable Performance

Action Cable seamlessly integrates websockets with Rails applications, providing both client-side JavaScript and server-side Ruby frameworks. It uses rack socket hijacking to take control of connections from the application server and manages connections internally in a multithreaded manner, layering channels over the socket connection. AnyCable acts as a bridge between a logic-less websocket server and ActionCable-like Ruby framework that supports the Action Cable protocol. It allows using alternative websocket servers like GRPC for better performance compared to ActionCable's default implementation.

Uploaded by

Khoa Dương
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views28 pages

AnyCable vs ActionCable Performance

Action Cable seamlessly integrates websockets with Rails applications, providing both client-side JavaScript and server-side Ruby frameworks. It uses rack socket hijacking to take control of connections from the application server and manages connections internally in a multithreaded manner, layering channels over the socket connection. AnyCable acts as a bridge between a logic-less websocket server and ActionCable-like Ruby framework that supports the Action Cable protocol. It allows using alternative websocket servers like GRPC for better performance compared to ActionCable's default implementation.

Uploaded by

Khoa Dương
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

ACTION CABLE

REAL-TIME RAILS ANY CABLE


• What are WebSockets?
• ActionCable
CONTENTS • ActionCable Chat Demo
• AnyCable
• AnyCable Chat Demo
HTTP AND
WEB SOCKETS
INTRODUCTION
ACTION CABLE

RailsConf 2015 April, 21

DHH - Creator of Ruby on Rails, Founder & CTO at Basecamp


ACTION CABLE SEAMLESSLY
INTEGRATES WEBSOCKETS WITH THE
REST RAILS APPLICATION.

A "FULL-STACK OFFERING": IT PROVIDES


BOTH A CLIENT-SIDE JAVASCRIPT
FRAMEWORK, AND A SERVER-SIDE RUBY
FRAMEWORK.

ACTION CABLE USES THE RACK SOCKET


HIJACKING API TO TAKE OVER CONTROL
OF CONNECTIONS FROM THE
APPLICATION SERVER. ACTION CABLE
THEN MANAGES CONNECTIONS
INTERNALLY, IN A MULTITHREADED
MANNER, LAYERING AS MANY CHANNELS
AS YOU CARE TO DEFINE OVER THAT
SOCKET CONNECTION.
IN A NUTSHELL
ActionCable: Easy configuration
PROS Application logic access through channels
JavaScript client that just works
ACTION CABLE - CHAT DEMO

• .

EMPIRICAL EVIDENCE

• Look in the slide notes below for topics to consider talking about
ActionCable: MemoryCable
CONS
WHY?
THE hijack PRICE - “Due to code duplication and extra work, the memory
consumption for hijack based solutions is higher and their performance is slower (more
system calls, more context switches, etc’)..” –Bo

• Long-lived objects
• Heap fragmentation
• ~
RUBY 3X3
ANYCABLE
ANYCABLE
GRPC

• gRPC is a modern open source high performance RPC framework that can run in any
environment. It can efficiently connect services in and across data centers with pluggable
support for load balancing, tracing, health checking and authentication. It is also applicable
in last mile of distributed computing to connect devices, mobile applications and
browsers to backend services.

ANYCABLE ACTS LIKE A BRIDGE BEETWEEN LOGIC-LESS WEBSOCKET SERVER AND ACTION
CABLE-LIKE RUBY FRAMEWORK (I.E. FRAMEWORK WHICH SUPPORT ACTION CABLE
PROTOCOL).
BENCHMARKS: ANYCABLE
ANY CABLE CHAT DEMO
MORE DOCUMENTS

• [Link]
• [Link]
[Link]
[Link]

You might also like