Ably accounts are priced based on the number of messages, the total bandwidth used, and the number of peak connections within any calendar month.  Find out more about account limits.

The count of messages is calculated as follows:

  • Publish / Subscribe
    • Every message published on a channel is counted as one message
    • Every message received on a channel is counted as one message. For example, if a client publishes a message on a channel with 10 subscribers, then that will count as one message published, and 10 messages received
    • Note: 
      • Client-side filtering of messages has no effect on message counting as all messages published on a channel are received by the client and the client-side filtering offered per channel is only a convenience provided for developers. See the realtime subscribing to messages documentation.
      • If echo messages is enabled (the default setting), then every message published on a channel using a realtime client is also echoed back to that client and will thus count as two messages (one published, one received).  See the echoMessages attribute of the client options documentation if you wish to disable automatic message echoing.
  • Presence
    • Every presence event published is counted as one message i.e. if a client enters, updates, or leaves a channel, that counts as one message.
    • Every presence event subscribed to is counted as one message. For example, if a client enters a channel and there are 10 subscribers listening for presence events, then that will count as one message published, and 10 messages received
  • History
    • Every message stored using our history feature counts as one message
    • Every message retrieved from history count as one message per message received
  • Reactor Queues, Events (WebHooks & Functions) and Firehose
    • Every message published to a Queue, WebBook, Function or Firehose will count as an additional message. For example, if you publish a message on a channel that is in turn republished to a Reactor Queue, that will count as two messages.
  • Smart Push Notifications
    • Every push notification delivered to a device counts as one message.  The count is the same irrespective of whether the message is broadcast via our channel fan-out functionality or published directly using the publish API.

The total bandwidth for an account is calculated based on the size of the name, data and extra fields of a message you publish.  The amount of bandwidth allocated to your account is calculated using the total number of messages in a month multiplied by the allowed average message size.  For example, on a free account with 3 million messages and an average message size of 2kb, the total bandwidth included in the month is 6.14GB.

You can view the total number of messages, bandwidth and connections in your account dashboard.  A sample screenshot can be seen below: