Meteor: Heroku vs. Node-Jitsu

540 views
Skip to first unread message

Phil Cockfield

unread,
Oct 29, 2012, 3:42:06 PM10/29/12
to meteo...@googlegroups.com

When I was playing around with Derby, there were special config mods you had to make to the Socket.io configuration when deploying to Heroku - namely:

  store.io.set 'transports', ['xhr-polling']
  store.io.set 'polling duration', 10


This is to do with the way Heroku works, which shuts down the socket connections after a time, and this configuration keeps them open.

I'm wondering, with Meteor, there are a couple of build-packs I've seen for deploying to Heroku (here and the meteorite one here), which suggests that Heroku is a popular place to deploy meteor (when not deploying the Meteor's own test servers).

Are there any equivalent moves I have to make in configuring Meteor for Heroku to make sure the clients remain connected - or does it "just work". (also, does Meteor use socket.io internally, or has it written it's own version of this?).

Alternatively, one of Node-Jitsu's advertised benefits is that it's optimised for these kinds of long running socket-connected apps.  But I haven't seen nearly as much discussion or tutorials for deploying meteor over to Node-Jitsu, so I'm wondering what the smart folks who understand the ins-and-outs of the socket system thinking when evaluating a PaaS platform for meteor apps?

Thanks!

Joc O'Connor

unread,
Oct 30, 2012, 1:30:06 PM10/30/12
to meteo...@googlegroups.com
Hi Phil,

I have been deploying to Heroku for a month or two with the oortcloud meteorite buildpack.

The only issues I had were that you have to set the ROOT_URL environment variable with the Heroku tools
and make sure your Heroku account was verified to accept the mongo add-on.

Everything after that "just worked"

HTH, Joc

Phil Cockfield

unread,
Oct 30, 2012, 1:37:25 PM10/30/12
to meteo...@googlegroups.com
Awesome - that's good to know, thanks Joc.  Yeah - I ran into that ROOT_URL thing yesterday too!

So, just to confirm - you're not noticing anything like the sockets going to sleep, or getting randomly disconnected after timeouts?

Joc O'Connor

unread,
Oct 30, 2012, 7:58:35 PM10/30/12
to meteo...@googlegroups.com
Phil, I have had a handful of people using the apps fairly thoroughly over that period and we are
starting to send prototype apps to clients. So far, we haven't received any reports of problems
with timeouts.

Saying that, from what I have read here or on IRC, can't remember which, I believe that Meteor isn't
using sockets yet but an emulation via a library call SockJS. Maybe someone from the dev team
can deny or confirm that, but I'm sure there are people who can explain properly.

Joc

Phil Cockfield

unread,
Oct 30, 2012, 9:02:47 PM10/30/12
to meteo...@googlegroups.com
Great feedback - thanks.  Good to know you're not feeling any weirdness on Heroku.  Makes life easier.

I just looked up SockJS.  If it's this library, it looks like it does use web-sockets when it can.


Under the hood SockJS tries to use native WebSockets first. If that fails it can use a variety of browser-specific transport protocols and presents them through WebSocket-like abstractions.
Source: https://github.com/sockjs/sockjs-client 


Thanks Joc.

matt debergalis

unread,
Oct 31, 2012, 1:52:27 AM10/31/12
to meteo...@googlegroups.com
This is true for stock SockJS. But Meteor disables websockets on the
client and only uses the SockJS emulation strategies.

Websockets don't work very well in the field. Reasons include
proxies, no native compression, inconsistent browser support, and
broken mobile networks. There's previous traffic on the list
detailing the problems, and Arnout's deck from last week's Realtime
Conference is worth a read:
https://speakerdeck.com/3rdeden/realtimeconf-dot-oct-dot-2012

cheers,
matt
> --
> You received this message because you are subscribed to the Google Groups
> "meteor-talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/meteor-talk/-/GhHIWBes_bkJ.
>
> To post to this group, send email to meteo...@googlegroups.com.
> To unsubscribe from this group, send email to
> meteor-talk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/meteor-talk?hl=en.

Phil Cockfield

unread,
Oct 31, 2012, 2:56:52 AM10/31/12
to meteo...@googlegroups.com
Woah - interesting to know.  I'm glad you're finding the emulation strategies to be good enough, or better than than the HTML5 bits.

Joc O'Connor

unread,
Oct 31, 2012, 7:53:35 AM10/31/12
to meteo...@googlegroups.com
To add a further 2 penneth,

years ago I wrote a realtime socket based server in Java for a staff training game written in Flash.

The first client we trialled it with was a high street bank.  There was no way they were going
to open their firewall to let this through. So we very quickly adapted it to use polling instead.

I think Meteor have made a very sensible and pragmatic choice to do the same for the
reasons Matt has mentioned. Socket work nicely in the right controlled environment but
not for general usage.

Joc
Reply all
Reply to author
Forward
0 new messages