Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Last active Nov 17, 2020
Embed
What would you like to do?
Persistent Connection Services - Pricing

Here I'm interested in a use case of subscribers keeping a permanent connection open (24/7), but with negligible amount of messages. So I'm only concerned about price per connection, not price per message.

AWS API Gateway

https://aws.amazon.com/api-gateway/pricing/

$0.25 per million connection minutes

That's $1 per 4 million connection minutes.

There's 43200 minutes in a (30 day) month. So $1 buys you 4,000,000/43,200 =~ 93 connections.

For every $1/month, we can serve 93 users

Pusher

https://pusher.com/channels/pricing

Lowest plan: $49 per 500 connections

Medium plan: $299 per 5000 connections

High plan: $1199 per 30,000 connections

That's approximately $1 per 10|17|25 connections.

For every $1/month, we can serve 10-25 users depending on plan size

PubNub

$49 per 1,500 _UNIQUE_ monthly users

This plan is a bit different because it charges per distinct users ("a UUID (universally unique identifier) that connects at least once to PubNub in one calendar month"). It works fine if you have a permanent set of employees or paying users, but less so for a freemium setup as the connections won't be interchangeable - each new user will increment the user count even if they only try it for a few minutes. It's also not clear if 24/7 usage from all users would be considered excessive, but probably not.

For every $1/month, we can serve ~30 UNIQUE users

Services with less clear pricing

Firebase Cloud Firestore

https://cloud.google.com/firestore/pricing

Technically possible, but pricing model makes it too hard to guess, would need to benchmark it

Heroku

https://devcenter.heroku.com/articles/play-java-websockets

No pricing information

Binnacle

https://elements.heroku.com/addons/binnacle#pricing

Only shows free pricing

Anything else, please list them!

Conclusion

Not surprisingly, AWS comes out cheapest by a considerable margin, but it's important to note that these are just back-of-the-envelope calculations and it's a very crude pricing model that doesn't take into account tiers, actual messages, and other factors. And even then, pricing is only one of many things to consider. Also, look at service reliability, developer experience, support, how likely the service is to stick around, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment