

Heroku WebSocket performance - hassy
http://veldstra.org/2013/10/25/heroku-websocket-performance-test.html

======
buster
Wow.. 160 connections per second sounds really slow.. is a dyno such a small
unit? Never worked with Heruko..

~~~
timdorr
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](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.

~~~
GrinningFool
Does pusher also work by holding open connections?

If so, it seems that neither option is very respectful of mobile users'
battery life...

~~~
beaumartinez
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.

~~~
CaveTech
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.

~~~
thatthatis
Is it the same result using cellular vs. using wifi?

~~~
CaveTech
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).

------
slig
Does anyone know if the free Dyno is always running or it's started once
there's a request and killed after a timeout?

I couldn't find this info in the pricing page.

~~~
ksylvest
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:

[https://devcenter.heroku.com/articles/dynos#dyno-
idling](https://devcenter.heroku.com/articles/dynos#dyno-idling)

~~~
felipesabino
Now you can also check if your app is sleeping on the dashboard :)

[https://blog.heroku.com/archives/2013/6/20/app_sleeping_on_h...](https://blog.heroku.com/archives/2013/6/20/app_sleeping_on_heroku)

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

------
thatthatis
How does 160 connection per dyno compare to comparably priced servers
elsewhere?

~~~
_neil
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.

------
swaagie
You might want to check out
[https://github.com/observing/thor](https://github.com/observing/thor), it's
basically wrk/ab for sockets.

------
bytasv
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?

