Please note: In legacy Ably packages, these were called 'peak' connections but the concept is the same
If your app dashboard shows that you have a higher than expected number of concurrent connections, then we recommend you consider all of the following that could be contributing to this problem:
-
Are you using a Realtime library server-side when you should in fact be using a REST library? If you use a Realtime library from your servers, then you must be aware that every time the library is instanced a connection is established to Ably and will not be closed unless you explicitly close the connection. See Should I use REST or Realtime library for a more detailed explanation.
-
Are you accidentally instantiating the Realtime client library multiple times in one page or app? You should only use a single instance of the realtime library per page/app, else each instance, unaware of the other, will maintain its own connection to Ably.
-
Are you aware that browser tabs are completely sandboxed from each other for security reasons and as such connections cannot be shared? If you are instancing a Realtime library in a browser, there will be one realtime connection per open tab. See the support article "Can a single connection be shared across multiple browser tabs?"
If you are unclear on how connections are counted, please see support article "How does Ably count concurrent connections?"
If none of the above helps resolve the unexpected high connection count, we recommend you first:
-
Use the developer console and monitor the connections being opened in realtime. This should help you identify the source of new connections.
-
Contact us with the necessary information we need to help us resolve your issue.
Finally, please note that if you significantly exceed your paid package limits or exceed your free package limits, we may block your account. Find out more about what happens when you exceed limits.