Spaces pricing
How Spaces SDK features contribute to your message count and strategies to optimize costs.
The Spaces SDK is built on top of Pub/Sub channels and presence. All Spaces operations generate Pub/Sub messages that follow the same counting rules.
Spaces operations
The following table shows how Spaces operations contribute to your message count:
| Operation | Messages counted |
|---|---|
| Members | |
| Enter space | 1 inbound message |
| Leave space | 1 inbound message |
| Update profile | 1 inbound message |
| Space event delivery | 1 outbound message per subscriber |
| Locations | |
| Set location | 1 inbound message |
| Location event delivery | 1 outbound message per subscriber |
| Cursors | |
| Set cursor position | 1 inbound message per batch (default batch interval 25ms) |
| Cursor event delivery | 1 outbound message per subscriber |
| Locking | |
| Acquire lock | 1 inbound message |
| Release lock | 1 inbound message |
| Lock event delivery | 1 outbound message per subscriber |
Registering multiple subscription listeners for the same event does not increase your message count. These are client-side filtered events where only a single message is published per event by Ably.
Channels
Each space maps to an underlying Pub/Sub channel. Live cursors use a separate channel from other space features due to their high update frequency. Both channels contribute to your channel count.
Connections
Ably bills each connected client for connection minutes. A connection-minute is counted for every minute a client maintains an open connection, regardless of activity. Clients that remain connected but idle still accrue connection minutes.
Cost optimization
Increase cursor batch interval
Increase the outboundBatchInterval to reduce the frequency of cursor position updates. The default is 25ms. Increasing this value reduces the number of messages at the cost of less smooth cursor movement.
Limit concurrent cursor streaming
Ably recommends a maximum of 20 members simultaneously streaming their cursors in a space for an optimal end-user experience. Beyond this, the volume of cursor messages increases significantly.
Use occupancy instead of presence for large spaces
For spaces with many members where you only need a count of active users, use occupancy on the underlying channel instead of tracking individual presence events.