Performance – Phoenix channel and its relationship with sockets

I need some suggestions about elixir/phoenix channels. I have an application related to venue changes, in order to reduce the amount of data sent to each client, I only want each client Subscribe to the places it cares about.

With this in mind, I thought of establishing a channel route for “VenueChanges/*” and letting each customer subscribe to the channel multiple times, and follow each A venue ID, namely “VenueChanges / 1”, “VenueChanges / 2”, “etc.

The venue that customers care about will change frequently, which means a lot of joining and leaving the channel.

I The question is, how much is the cost of having customers join the channel multiple times. Am I correct to assume that there is still only one socket open and there is no new socket for each channel that joins?

About managing customers Is there any suggestion to keep joining and exiting channels? Other suggestions in general? If this is a bad idea, what is a better option?

Regarding the socket problem, you are correct, because each client still has only one socket (multiple channels are multiplexed on this socket).

Although there is no direct answer to your unanimous join/leave question, Chris McCord’s post on Phoenix Channels vs Rails Action Cable has some very good performance data, which is best summarized as follows:

< /p>

With Phoenix, we’ve shown that channels performance remains consistent
as notification demand increases, which is essential for handling
traffic spikes and avoiding overload

In other words, your server hardware and deployment and distribution strategy will also play an important role in answering this question.

Finally, based on what you mean by joining/leaving the channel topic (or in some Some places are called “rooms”), as shown in Chris’ 55,000 connection test:

It’s important to no te that Phoenix maintains the same responsiveness when broadcasting for both the 50 and 200 users per room tests.

I need some advice on elixir/phoenix channels. I have an application related to venue changes. In order to reduce the amount of data sent to each client, I only want each customer to subscribe to the venue it cares about.

Considering this, I I thought of the route of establishing a channel for “VenueChanges/*”, and let each customer subscribe to the channel multiple times and pay attention to each venue ID, that is, “VenueChanges/1”, “VenueChanges/2”, etc.

The venue that customers care about changes frequently, which means a lot of joining and leaving the channel.

My question is, how much is the cost of getting customers to join the channel multiple times. Am I correct to assume that there is still only one The socket is opened and there are no new sockets for each channel added?

Are there any suggestions for managing customers who continue to join and exit channels? Any other suggestions in general? If this is a bad idea, what is a better option?

About the socket problem, you are correct, because each client still has only one socket (multiple channels on this socket (Reuse).

Although there is no direct answer to your unanimous join/leave question, Chris McCord’s post on Phoenix Channels vs Rails Action Cable has some very good performance data, it is best to summarize As follows:

With Phoenix, we’ve shown that channels performance remains consistent
as notification demand increases, which is essential for handling
traffic spikes and avoiding overload

In other words, your server hardware and deployment and distribution strategy will also play an important role in answering this question.

Finally, based on what you mean It’s to join/leave the channel theme (or “room” in some places), as shown in Chris’ 55,000 connection test:

It’s important to note that Phoenix maintains the same responsiveness when broadcasting for both the 50 and 200 users per room tests.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2642 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.