Cluster Configuration
A "cluster" represents the physical location of the servers that handle requests from your Channels app. For example, the Channels cluster mt1
is in Northern Virginia in the United States. When you create a Channels app, you can choose which cluster it exists in. You might choose this to achieve lower latency or to comply with data protection regulations.
Channels has the following public clusters:
mt1
in N. Virginiaus2
in Ohious3
in Oregoneu
in Irelandap1
in Singaporeap2
in Mumbaiap3
in Tokyoap4
in Sydney
If you require other locations, we can create dedicated Channels clusters in custom locations on request: talk to us.
- To achieve lower network latency.
- Depending on your use case, having your Channels app hosted close to its customers or your servers may help improve the latency when sending and receiving messages.
- We recommend that you test on multiple clusters and pick the one that works best for your app.
- To comply with data protection regulations.
- European data protection regulations specify that personal user data should not leave the EU borders.
- For this use-case, Channels offers a cluster in
eu-west-1
, an AWS datacenter located in Ireland.
Where it says APP_CLUSTER
you'll need to insert the relevant cluster shortcode (e.g. mt1
).
- JavaScript
- Swift
- Objective-C (PusherSwift)
- Objective-C (libPusher)
- Java
- Laravel Echo
- .NET
1 2 3
var pusher = new Pusher("APP_KEY", { cluster: "APP_CLUSTER" });
- Ruby
- PHP
- Laravel
- Node.js
- ASP.NET MVC
- Python
- Go
- Java
1 2 3 4 5 6 7 8
require 'pusher' pusher = Pusher::Client.new( app_id: 'APP_ID', key: 'APP_KEY', secret: 'APP_SECRET', cluster: 'APP_CLUSTER' );
- Setting the
cluster
option will change thehost
parameter of the Channels library you are using. This happens only when thehost
option is not set, in which case,cluster
is ignored. - For client libraries, the default host is
ws.pusherapp.com
(andsockjs.pusherapp.com
for fallback transports). Withcluster
set, the host becomesws-cluster.pusher.com
(andsockjs-cluster.pusher.com
respectively). - For server libraries, the default host is
api.pusherapp.com
. Withcluster
set, the host becomesapi-cluster.pusher.com
.
- First make sure your app is created in the intended cluster and that all the Channels libraries you are using in your project are configured correctly.
- Make sure your app makes requests to the correct endpoints. On the server-side, use a traffic sniffing tool like tcpdump. On the client-side, open your browser's developer tools and inspect the network requests.
- Contact support