5 ms·
I'm in the unfortunate position where this question actually matters from day 1. I learnt the hard way a few days ago when I hit the bottleneck (about 50-100 co
by hopfog 10y ago
I'm in the unfortunate position where this question actually matters from day 1. I learnt the hard way a few days ago when I hit the bottleneck (about 50-100 concurrent users) and I'm not sure how to proceed.
It's a multiplayer drawing site built with Node.js/socket.io. I'm already on the biggest Heroku dyno my budget can allow and it's too big of a task to rewrite the back end to support load balancing (and I wouldn't know where to start). Bear in mind that this is a side-project I'm not making any money of.
I had a lot of new features planned but now I've put development on hold. It's not fun to work on something you can't allow to get popular since it would kill it.
- Everhusk 10y agoHey, you might want to check out https://realm.io/ https://realm.io/ , the demo is exactly what you said. Good luck!
- hopfog 10y agoLooks cool but seems like it's aimed at mobile and not websites? Also, how do they differ from Firebase? My previous experience with Firebase makes me hesitant to use a BaaS. It works great for simple stuff but as soon as you want more control it becomes a mess compared to just having your own server. It might just be me who haven't wrapped my head around the mindset correctly though.
- yxhuvud 10y agoWhat is it your processor spends its time on? Perhaps those parts could be rethought and redesigned? Perhaps heroku is the wrong solution for those tasks even if it is good for the rest of the app. Would it be possible to find something cheaper for just those parts?
- hopfog 10y agoTo be honest I haven't really benchmarked it. Maybe that's something I should invest time in to see if there's some obvious bottleneck I can fix. Thanks for the suggestion.
- true_religion 10y agoHeroku is fairly expensive. Could you not port this to a more dedicated server? Yes, it's likely complicates deployment but for a few hours of work in initial deployment, you can save hundreds of hours rewriting your codebase.
- hopfog 10y agoI'm thinking about it but I'm no server admin so it feels a bit scary. I could probably do it quite easily but it would be a security nightmare.
- weitzj 10y agoMaybe you could rely on Firebase for the real-time db stuff and do the drawing there.
- hopfog 10y agoI actually used Firebase for the first version but ran into a lot of different issues, mostly due to the lack of control. That's why I migrated to my own Node server where I could have my own back end logic to control things. This was many years ago though so maybe I should have a look at it again.
- stevewilhelm 10y agoI think what the author of the original article would suggest that you need to convert some of the concurrent users to paying customers and use the money to purchase additional Heroku dynos.
- hopfog 10y agoI don't think that's possible for me. I have some future monetization plans but that requires features I don't have yet. At the current state I have a hard time seeing anyone would pay for it. Also, due to how the back end is structured it's not possible to scale horisontally at the moment so all I could do with money is beefing up the current dyno, not adding more.
- sah2ed 10y ago> At the current state I have a hard time seeing anyone would pay for it. You'll never know for certain until you try. You need to ask put a dollar sign and see how current users respond. Of course only a handful of users will pay, after which you can slowly ramp up prices as you build out the features you have planned.
- spacetexas 10y agoSocket.io can't handle many connections you're right. I would use (universal) Web Sockets (This is a good abstraction library, very easy to implement). https://github.com/primus/primus https://github.com/primus/primus Maybe put it on a Digitalocean Server and just reference your Dyno's IP address if possible.
- hopfog 10y agoThanks! Looks good so that's definitely something I should look more into.