Re:Heroku WebSocket performance
by timdorr on Monday October 28, 2013 @02:07PM
(#6628622)
These are WebSockets, not typical HTTP requests. Connections/sec is less important because they will be long-running. The client is not continually reconnecting as they do with an HTTP request.
What matters most is total connection count, which appears to be very high. At 6,000 open connections on a free dyno, that is better than Pusher's $199/mo plan: http://pusher.com/pricing
I think what needs to be done after this is checking how much data can be sent per second. Both in terms of raw bandwidth and messages/sec.
Re:Heroku WebSocket performance
by bradgessler on Monday October 28, 2013 @07:20PM
(#6630534)
If you're looking for Pusher functionality to run on Heroku, check out http://firehose.io/. Its open-source, so no vendor lock-in and we pump millions of messages through it in production at Poll Everywhere.
I haven't deployed it to Heroku yet, but if somebody does please let me know how it goes!
Re:Heroku WebSocket performance
by m0th87 on Monday October 28, 2013 @02:48PM
(#6628935)
Obviously take this with a grain of salt since I didn't publish anything, but When I did some analysis on battery life impact of HTTP polling vs websockets two years ago, the difference was completely negligible compared to keeping the screen on (which I had to do for the analysis) on the iPhone 4. This makes sense in retrospect, but it appears as if websockets don't have a huge impact.
Re:Heroku WebSocket performance
by beaumartinez on Monday October 28, 2013 @03:04PM
(#6629081)
Correct me if I'm wrong, but isn't the point of web sockets a persistent connection to the server, to facilitate sending updates? You assume the battery life hit in using them.
It'd be interesting to see the trade-offs between web sockets and persistent polling.
Re:Heroku WebSocket performance
by CaveTech on Monday October 28, 2013 @03:48PM
(#6629314)
I did extensive research on this about 2 years ago for Android. Holding long standing connections is much more efficient than using multiple HTTP requests, polling included.
The reason being mainly the session negotiation and teardown required for making multiple requests, and the fact that the antenna required a higher energy state for creating a new connection compared to keeping an existing connection open.
Re:Heroku WebSocket performance
by CaveTech on Monday October 28, 2013 @07:59PM
(#6630759)
Somewhat, but multiplicative. Wifi requires a good deal more power to begin with, and the high power state of wifi is one of the biggest drains on battery life (after the screen).
Re:Heroku WebSocket performance
by tlrobinson on Monday October 28, 2013 @02:52PM
(#6628984)
That's 160 new long-lived connections per second, which will presumably stay open for the entire duration the user is on a webpage.
If you're getting 160 users connecting per second the 6000 concurrent connection limit will be hit in less than a minute, assuming most users stay on the page for longer than a minute.
Re:Heroku WebSocket performance
by rdegges on Monday October 28, 2013 @04:00PM
(#6629373)
Correct. If you're running more than one dyno in an app, however, there are no 'timeouts'.
If you're trying to maximize your free dyno usage, however, you might want to use the 'heroku scheduler' addon, and have it ping your app once every 10 minutes to keep it 'awake'.
Re:Heroku WebSocket performance
by derekchiang on Monday October 28, 2013 @03:36PM
(#6629253)
Yeah, it's killed after a timeout and restarted when a new request comes in. Which is why when you revisit an old Heroku app it takes a long time to load.
Re:Heroku WebSocket performance
by ksylvest on Monday October 28, 2013 @03:58PM
(#6629365)
You can keep a single free Dyno "awake" by hitting it with a request at least once per hour. If you use New Relic the built in availability monitoring will do the trick and otherwise Scheduler should work. For more info:
Also, I used pingdom.com once to make sure that my "very low in traffic" app never sleeps, but any solution that performs a request in this interval would be valid
Re:Heroku WebSocket performance
by _neil on Monday October 28, 2013 @02:37PM
(#6628842)
That's per dyno, per second. 6,000 per dyno total, which seems very reasonable. As timdorr mentioned, Pusher's largest (publicly available?) plan only allows for 5,000 connections.
Re:Heroku WebSocket performance
by bradgessler on Monday October 28, 2013 @07:16PM
(#6630516)
We run http://firehose.io/ on smaller SoftLayer metal servers and get around 10k connections per box. These servers cost $250 per month, so we get about 20k connections for $500 per month. By my back of napkin numbers Heroku is about 10x the cost of real metal servers.
Re:Heroku WebSocket performance
by hassy on Monday October 28, 2013 @07:13PM
(#6630496)
I ran a quick test, an entry-level box from Digital Ocean can sustain 350+ connections/sec and maxes out at around 7,200 open connections.
Having root access to the machine would allow you to optimise some things and probably raise those numbers, but then you don't get the convenience of using Heroku.
Re:Heroku WebSocket performance
by bytasv on Thursday October 31, 2013 @04:00AM
(#6645699)
It would be really interesting to see the same test done with 2 and then maybe 3 dynos running. I'm wondering how well would that scale with more dynos running. Is it possible to buy dynos for shorter time than a month?
What matters most is total connection count, which appears to be very high. At 6,000 open connections on a free dyno, that is better than Pusher's $199/mo plan: http://pusher.com/pricing
I think what needs to be done after this is checking how much data can be sent per second. Both in terms of raw bandwidth and messages/sec.
I haven't deployed it to Heroku yet, but if somebody does please let me know how it goes!
These are on the list :)
If so, it seems that neither option is very respectful of mobile users' battery life...
It'd be interesting to see the trade-offs between web sockets and persistent polling.
The reason being mainly the session negotiation and teardown required for making multiple requests, and the fact that the antenna required a higher energy state for creating a new connection compared to keeping an existing connection open.
If you're getting 160 users connecting per second the 6000 concurrent connection limit will be hit in less than a minute, assuming most users stay on the page for longer than a minute.
I couldn't find this info in the pricing page.
If you're trying to maximize your free dyno usage, however, you might want to use the 'heroku scheduler' addon, and have it ping your app once every 10 minutes to keep it 'awake'.
https://devcenter.heroku.com/articles/dynos#dyno-idling
https://blog.heroku.com/archives/2013/6/20/app_sleeping_on_h...
Also, I used pingdom.com once to make sure that my "very low in traffic" app never sleeps, but any solution that performs a request in this interval would be valid
Having root access to the machine would allow you to optimise some things and probably raise those numbers, but then you don't get the convenience of using Heroku.