goOffline() to reduce # of active connections?

2,076 views
Skip to first unread message

Scott Morton Ashton

unread,
Jan 4, 2014, 5:05:13 AM1/4/14
to fireba...@googlegroups.com
I'm trying to figure out how specifically the number of active connections is calculated on Firebase, primary because of its importance with Firebase billing. If every single user on every single tab they have open is opening up a separate firebase connection, the bill could get very large very quick, and I'm only working on a hobby project that has gained a decent amount of traction. I'm using this stack overflow thread as my basis for what qualifies as an "active connection".

So I guess my first question is: does going offline with goOffline() close a connection for purposes of computing # active connections in billing? If it does, the ideal use case would be to initialize the data on load using a quickly opened and closed connection with Firebase and then only open that connection as needed. IE accessing a section of the site that requires more data or real time syncing across clients.

And the second question is this: if so, would this be an abuse of the system? While it would be WONDERFUL to not have to deal with the database on the server and just get all my data from Firebase, but it would suck to have my site quickly enter into the more pricier plans because of proliferation of mostly-not-being-used connections. 

Thanks,
-Scott

Andrew Lee

unread,
Jan 5, 2014, 6:28:13 PM1/5/14
to fireba...@googlegroups.com
Hi Scott -

The goOffline() command does exactly what you describe, and it's there for people who are trying to reduce their concurrent user counts.

That said, I strongly recommend you not worry about it unless you're actually bumping up against our limits. Calling goOffline() will mean you no longer receive updates from other users, which is usually the point of using Firebase in the first place.

In addition, most developers vastly overestimate the number of concurrent users they will have. A good rule of thumb is 1 concurrent = 1000 monthly visits for the typical website. For mobile, the ratio between installs and concurrents is sometimes even higher (though it varies considerably depending on your use case). Our plans are quite generous when it comes to concurrent users. As a data point -- our own website could operate comfortably on the "free" Firebase plan most days. In fact, more than 99.5% of all of Firebases never hit the 50 concurrent limit.

So, long story short, if you're working on a hobby project, you will almost certainly not hit our free tier 50-concurrent limit. If you're a business or a larger app, I hope you will find our $49 / month plan more cost-effective than spending engineering time to figure out when to goOnline / goOffline to minimize that number.

At the very high end (huge Enterprise apps with 10k+ concurrents) we do offer custom pricing that has a lower per-concurrent rate.

I hope that helps! Best - 

-Andrew


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Andrew Lee
Founder, Firebase
http://twitter.com/startupandrew

Andrew Lee

unread,
Jan 5, 2014, 6:29:12 PM1/5/14
to fireba...@googlegroups.com
Also note that we bill at the 95th percentile of usage, not peak, so if you have a big spike on launch day or otherwise have bursty traffic, we won't charge you for that.

-Andrew

Adam Brooks

unread,
Jan 10, 2014, 6:34:38 AM1/10/14
to fireba...@googlegroups.com
You guys rock so hard! 

You're amazing, please do keep up the awesome work!

Қанат Қожахмет

unread,
Apr 22, 2015, 11:47:48 AM4/22/15
to fireba...@googlegroups.com
Hi Andrew Lee!

Now we are planing to use firebase (we have mobile application taxi service like uber), would you be so kind to answer to my question
here is the case

In our system we have 10.000 active drivers, active means that their running application update information about orders (normal users also open application and and do an order)
these 10.000 will see this order. So does it mean we have 10.000 conncurent connections?

And second question is if we would have 40.000 conncurrent connection, what will be pricing for us?


Thank you very much!

Jacob Wenger

unread,
Apr 22, 2015, 11:49:40 AM4/22/15
to fireba...@googlegroups.com
Hey there,

Please send your inquiry to sup...@firebase.com. We can give you some more personal attention there.

Jacob

Reply all
Reply to author
Forward
0 new messages