News for hackers. Stuff that matters.
Re:WebSockets cost us $1M on our AWS bill by gwbas1c on Wednesday November 06, 2024 @04:25PM (#42069673)
Classic story of a startup taking a "good enough" shortcut and then coming back later to optimize.

---

I have a similar story: Where I work, we had a cluster of VMs that were always high CPU and a bit of a problem. We had a lot of fire drills where we'd have to bump up the size of the cluster, abort in-progress operations, or some combination of both.

Because this cluster of VMs was doing batch processing that the founder believed should be CPU intense, everyone just assumed that increasing load came with increasing customer size; and that this was just an annoyance that we could get to after we made one more feature.

But, at one point the bean counters pointed out that we spent disproportionately more on cloud than a normal business did. After one round of combining different VM clusters (that really didn't need to be separate servers), I decided that I could take some time to hook up this very CPU intense cluster up to a profiler.

I thought I was going to be in for a 1-2 week project and would follow a few worms. Instead, the CPU load was because we were constantly loading an entire table, that we never deleted from, into the application's process. The table had transient data that should only last a few hours at most.

I quickly deleted almost a decade's worth of obsolete data from the table. After about 15 minutes, CPU usage for this cluster dropped to almost nothing. The next day we made the VM cluster a fraction of its size, and in the next release, we got rid of the cluster and merged the functionality into another cluster.

I also made a pull request that introduced a simple filter to the query to only load 3 days of data; and then introduced a background operation to clean out the table periodically.

Re:WebSockets cost us $1M on our AWS bill by alsetmusic on Wednesday November 06, 2024 @05:08PM (#42070228)
As much as you can say (perhaps not hard numbers, but as a percentage), what was the savings to the bottom line / cloud costs?
Re:WebSockets cost us $1M on our AWS bill by gwbas1c on Wednesday November 06, 2024 @05:25PM (#42070472)
Probably ~5% of cloud costs. Combined with the prior round of optimizations, it was substantial.

I was really disappointed when my wife couldn't get the night off from work when the company took everyone out to a fancy steak house.

Re:WebSockets cost us $1M on our AWS bill by chgs on Wednesday November 06, 2024 @05:42PM (#42070695)
So you saved the company $10k a month and got a $200 meal in gratitude? Awesome.
Re:WebSockets cost us $1M on our AWS bill by bagels on Wednesday November 06, 2024 @06:27PM (#42071178)
They're presumably already being paid a salary to do this work.
Re:WebSockets cost us $1M on our AWS bill by Cyphase on Wednesday November 06, 2024 @06:07PM (#42070984)
What should they have gotten?
Re:WebSockets cost us $1M on our AWS bill by tempest_ on Wednesday November 06, 2024 @06:39PM (#42071319)
They are in theory owed nothing more than their salary but it can be very good for moral to reward that type of thing (assuming they are not introducing a perverse incentive)
Re:WebSockets cost us $1M on our AWS bill by _hyn3 on Wednesday November 06, 2024 @06:37PM (#42071281)
> So you saved the company $10k a month and got a $200 meal in gratitude? Awesome.

You seem to be assuming that a $200 meal was the only compensation the person received, and they weren't just getting a nice meal as a little something extra on top of getting paid for doing their job competently and efficiently.

But that's the kind of deal I make when I take a job: I do the work (pretty well most of the time), and I get paid. If I stop doing the work, I stop getting paid. If they stop paying, I stop doing the work. (And bonus, literally, if I get a perk once in a while like a free steak dinner that I wasn't expecting)

It doesn't have to be more complicated than that.

Re:WebSockets cost us $1M on our AWS bill by meiraleal on Wednesday November 06, 2024 @06:56PM (#42071494)
Yeah? Well, proper rewards make those savings and optimizations more common. Otherwise most people will do the work needed just to have work tomorrow.
Re:WebSockets cost us $1M on our AWS bill by Sohcahtoa82 on Wednesday November 06, 2024 @07:45PM (#42071927)
It creates a perverse incentive to deliberately do things a more expensive way at the beginning and then be a hero 6 months down the line by refactoring it to be less expensive.
Re:WebSockets cost us $1M on our AWS bill by fn-mote on Wednesday November 06, 2024 @09:37PM (#42072745)
Ha ha, software developers already have this incentive. Viz: "superhero 10x programmer" writing unmaintainable code to provide some desirable features, whose work later turns out to be much less awesome than originally billed.

Of course the truth is more complicated than the sound bite, but still...

Re:WebSockets cost us $1M on our AWS bill by groby_b on Wednesday November 06, 2024 @08:23PM (#42072237)
Depends. There are people who put in the absolute minimum work they can get away with, and there are people who have pride in their profession.

That's independent of pay scale.

Granted, if you pay way below expectations, you'll lose the professionals over time. But if you pay lavishly no matter what, you get the 2021/2022 big tech hiring cycle instead. Neither one is a great outcome.

Re:WebSockets cost us $1M on our AWS bill by meiraleal on Thursday November 07, 2024 @07:44AM (#42076161)
A business that relies on people having pride in their profession won't scale. Proper rewards scale.
Re:WebSockets cost us $1M on our AWS bill by groby_b on Saturday November 09, 2024 @11:36AM (#42095293)
We demonstrated in 2022 that they don't.

There is no single mechanism that does. Paying well is always a component in attracting talent (see my original comment)

It is not a guarantor of quality/motivation. That's ongoing leadership work. And part of that is maintaining/kindling pride in people's work (and firing the ones who are just there for the money)

Re:WebSockets cost us $1M on our AWS bill by ponty_rick on Wednesday November 06, 2024 @06:36PM (#42071275)
They're more pissed about the 1.2M they spent than about the 10k a month they saved.
Re:WebSockets cost us $1M on our AWS bill by ChadNauseam on Wednesday November 06, 2024 @08:48PM (#42072406)
I'm not sure how they feel, but when it happens to me, it's not a big deal because it's my job to do things like that. If I fuck up and cost them $10k/month I'm certainly not going to offer to reimburse them.
Re:WebSockets cost us $1M on our AWS bill by wellthisisgreat on Wednesday November 06, 2024 @11:36PM (#42073448)
Yeah, oppositely they should share the downsides of the burdens lol
Re:WebSockets cost us $1M on our AWS bill by gwbas1c on Thursday November 07, 2024 @11:30AM (#42078121)
The dinner was to celebrate getting acquired, which was a wide team effort. The cost savings I did was one of the pieces I contributed.

Don't assume that a steak dinner was the only recognition we got.

As far as comp: I was well taken care of, and I won't discuss more in a public forum.

Re:WebSockets cost us $1M on our AWS bill by antisthenes on Wednesday November 06, 2024 @05:40PM (#42070679)
99% of the time, it's either a quadratic (or exponential) algorithm or a really bad DB query.
Re:WebSockets cost us $1M on our AWS bill by dd82 on Wednesday November 06, 2024 @06:02PM (#42070922)
can also be a linear algorithm that does N+1 queries. ORMs can be very good at hiding this implementation detail
Re:WebSockets cost us $1M on our AWS bill by Quekid5 on Wednesday November 06, 2024 @07:04PM (#42071567)
> a linear algorithm that does N+1 queries.

That's what quadratic means.

Re:WebSockets cost us $1M on our AWS bill by sgerenser on Wednesday November 06, 2024 @07:58PM (#42072056)
Typically implemented accidentally: https://www.tumblr.com/accidentallyquadratic
Re:WebSockets cost us $1M on our AWS bill by jon_richards on Wednesday November 06, 2024 @09:27PM (#42072666)
Re:WebSockets cost us $1M on our AWS bill by nwellnhof on Thursday November 07, 2024 @01:11PM (#42079211)
No, N+1 is still linear.
Re:WebSockets cost us $1M on our AWS bill by DylanSp on Thursday November 07, 2024 @10:55AM (#42077743)
It wasn't a financial cost, but the biggest single performance improvement I've seen firsthand came from optimizing a SQL query. One of our Professional Services people had written a query that did repeated self-joins on a fairly large table, which took ~15 minutes to run. A DBA-turned-dev on our team rewrote it using MSSQL's PIVOT operator, and the query started executing in less than a second.
Re:WebSockets cost us $1M on our AWS bill by magundu on Wednesday November 06, 2024 @10:05PM (#42072931)
Great.

It will be great if anyone write a checklist(playbook) to be checked for CPU, Memory, Disk, IO and network issues.

Re:WebSockets cost us $1M on our AWS bill by sly010 on Wednesday November 06, 2024 @10:41PM (#42073139)
Hah. At a previous place I found that our cloud cost consisted of 90% storage costs. The data? Tens of thousands of incomplete backups of the in-office file server. 3 years of the NAS continuously trying to back itself up to S3 and failing every time.
Re:WebSockets cost us $1M on our AWS bill by declan_roberts on Wednesday November 06, 2024 @11:18PM (#42073360)
I love these stories. I have a few as well. In the end I know we're all just doing our job, but I've been tempted at times to say to my manager: "I will save the company $10k/month tomorrow if you give me a cut of the pie."
Re:WebSockets cost us $1M on our AWS bill by euroderf on Thursday November 07, 2024 @05:30AM (#42075417)
This should be the norm, actually.

It drives ya nuts to read a story where some guy on the shop floor saves his employer ten million dollars and to reward him they give him a 20% off coupon for Home Depot.

Re:WebSockets cost us $1M on our AWS bill by freedomben on Thursday November 07, 2024 @10:15AM (#42077354)
This sounds nice in theory, but would incentivize people to introduce unnecessarily expensive things initially and optimize them later to claim some of the savings. We would like to think that nobody would do something like that, but the sad reality is that there are plenty, especially as the potential reward goes up high enough.
Re:WebSockets cost us $1M on our AWS bill by zuhsetaqi on Thursday November 07, 2024 @11:16AM (#42077970)
> It drives ya nuts to read a story where some guy on the shop floor saves his employer ten million dollars and to reward him they give him a 20% off coupon for Home Depot.

It’s your job as an employee, it’s why you get paid in the first place

Re:WebSockets cost us $1M on our AWS bill by mgkimsal on Friday November 08, 2024 @10:54AM (#42087759)
Is it? Or is an employee's job to just do the work they're asked to do?

"It depends" is, of course, the common answer, but in most places I've worked, "please help find operational optimizations that can have a positive impact for the team, department or organization" has certainly never been an explicit ask.

Ask team mates to change something to help on a project may fall under the same category, but usually the effect isn't felt beyond a project.

My default mode when coming in to jobs is to try to get a 'full company' view, because I want to know how things work and how they might be made better. That approach is usually not met with much enthusiasm, and usually more with "that's not your job, you don't need to know that", etc.

I took a daily import routine that was taking 25+ hours (meaning we couldn't show 'daily info' because it was out of date before finishing import) and got it down to 30 minutes. This was after having to fight/argue to see the data, and being told for a couple weeks "it can't be sped up, we'll have to buy faster hardware" ($8-$10k min, but they weren't looking at $15-20k IIRC). I spent a few hours over a weekend and got it down to 30 minutes, and saved the company minimum $8k. But I had to fight/argue to even do that ("that's not your job", "Charles is taking care of that", "the client will just have to deal with more delays while we upgrade", etc).

Re:WebSockets cost us $1M on our AWS bill by evoke4908 on Saturday November 09, 2024 @12:35PM (#42095626)
Uh, no. Have you ever been employed? Your job is what is laid out in your contract, period. You are paid to do that specific set of tasks and nothing else. "Other duties as required" be damned.

Fixing the business is very explicitly not your job, and is absolutely not what you're paid for. Any value you create for the business outside of those bounds is at your own cost and you absolutely will not be compensated unless the business is so small you don't have six layers of management trying to extract any kind of promotion.

Re:WebSockets cost us $1M on our AWS bill by 7jjjjjjj on Thursday November 07, 2024 @11:52AM (#42078375)
Boss makes a dollar, I make a dime, that's why my code runs in exponential time.
Re:WebSockets cost us $1M on our AWS bill by misstercool on Thursday November 07, 2024 @12:03AM (#42073568)
It is a good problem to have for a startup, most startups are struggling finding customers to use their thing. Better to go with "good enough" shortcut and prioritize on growth. Recall is a YC company, I am sure they took advantage of huge amount AWS of credits in the first few years.