by silversmith · 4y ago · 0 comments
Feeling like a rockstar while developing. Impressing the colleagues and clients with how amazing functionality I could produce in so little time.
Then the absolute horror of production traffic hitting the system and everything grinding to a halt. If I remember correctly, the resources required by their reactive data model scaled up significantly both with read connection count and write activity. And I could not do a damn thing about it without a complete rewrite. First and only real case in my career where I simply could not solve the problem, not even a small part of the problem.
Oh, and it also let me experience running Mongo as primary data source. A lot of experience gained courtesy of meteor.js, for sure, but I'd prefer it to stay in rear view mirror for sure.
(The quote has to be understood in its original context. It isn't really about performance as such, but about maintaining degrees of freedom and development flexibility until you understand the problem you are solving and can commit)
I think the path of least conflict is usually to encourage people to develop quick benchmarks and test their assumptions and then ask questions about how they plan to address any problems that identify themselves. If people are receptive another useful piece of advice is that they shouldn't be afraid of just starting over if it is really early in the project.
In testing it was beautiful. With simulated updates on local machine, instant updates. Instant. Everyone's happy. Deployed to the server, and connected to the data firehose? Feedback is still okay, with just the clients employees and us browsing every now and then. Slightly slower, but hey it's on a remote server now, that's got to be the issue.
Went live, client ran the advertising campaign, and users flocked. Thing is, they flocked all during the same time, when the games were on. And updates were coming fastest while the games were on. Both of those things multiplied together to firmly peg server CPUs at 100%. Clients were also not thrilled about throwing more and more boxes at it to try to stop the bleeding. Resource consumption was going up geometrically with user count, something I hadn't seen before with any technology stack.
All in all, it taught me there is no such thing as free lunch. You pay somewhere - worse developer experience, more resource requirements, development costs and time. No such thing as a silver bullet.
Also, keeping data in sync without transactions in a Mongo cluster provided endless educational entertainment. We needed to process incoming payment confirmations from the bank, and update the "credits" balance of users. Entirely too often one of those would fail, especially under load. I hear it's gotten better, but I still refuse to treat Mongo as anything but a non-authorative cache since then.
I'll just add that meteor served our needs very well back then, and handled being (top I think for a while?) on hn with no problems.
Did a basic test of our new new thing, seemed to hum along okay at 10 w/sec and ~50 reads/sec - short writeup here : https://quantblog.wordpress.com/2022/06/26/mon-pho-aka-how-f...
At the end of the day though, what matters is whether or not your application scales appropriately for your expected workload.
If your expected workload is ten writes per second, then trying to get every single bit of performance out of the hardware is probably not time well spent. If you're having to handle thousands of writes per second and you're getting ten writes per second per server, then it's probably worthwhile to look into what's causing that number to be so low.
https://quantblog.wordpress.com/2022/06/29/node-js-perf-foll...