Back
Question
Asked

Had 100 people online. Then Server crashed. How to build a scalable webapp?

Hey WIP,

Bad day today. My Heroku console has 1803 critical errors :( Are critical errors common?

Looking at the specifics:

a) I'm using 1X professional heroku dynos. Surely they can handle this level of traffic?

b) I made a big mistake with images. Trying to write them to Heroku. Hopefully this accounted for a lot of my problems. When I swap to cloudinary hopefully this works better.

c) I'm not sure how well I'm handling errors. Or if this is causing part of the problem. I didn't bother with a 404 page for instance.

c) Are there any useful tools to simulate users or requests to see if we can handle the scale of traffic?

I suppose I'm trying to identify what exactly went wrong, so this doesn't happen again. But I'm not really sure where to begin. Any pointers, further questions appreciated.


Sorry not an answer, basically just adding to this. I would also be interested in this, as I'm running Heroku hobby plan and will be getting users on soon. Based on the fact you have Pro and this is happening, I'm probs screwed on hobby..

nope. turns out i was saving images directly to heroku which is very bad

What is your server/dyno running?

had it on hobby . then upgraded to 2X professional. Surely that must cover 100 people at once?

What language/framework are you using?

node js. pug(jade) for templating.

Bundling js with webpack

Seems like it should support 100 concurrent users. There's probably blocking code somewhere... node.js should block as little as possible.

i thought heroku should handle that also.

i was trying to write images to heroku so i think there was massive problems there. but there could be other problems as well. difficult to tell.

i know this is a bit cheeky, but it would be a dream if you could cast your eye over a few of my controller methods (not even sure if you know node / mongo that well)

I'm still learning myself, but feel free to post something. If I don't see something, maybe someone else here will. Also a clue would be in chrome dev tools, Network tab, if you see long running requests... its no bueno. Building Asynchronous software takes intention though...

Maybe you should look into message queues... like RabbitMQ

Heroku has separate "work dynos" right? Maybe that's key, how to move work from your web dynos to your workers dynos?

Yes, you can test it for free here:
loadimpact.com/
I'm making a node.js app too so i was looking to make similar tests.