News for hackers. Stuff that matters.
Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by andrewmcwatters on Tuesday September 05, 2023 @05:34PM (#37398081)
I would love to know what software stack, hardware, and uplink connections in total they utilize to accomplish a real-world 80k request per second throughput. How many instances do you guys think Amazon runs for its primary e-commerce front-end stack? In total, and per region? Assuming they have a multi-region rollout.

If it's the real-deal, and not like people saying "Bun.js can serve 65k req/s+ (cough cough to localhost,)" that's impressive.

But I never see anyone talk about real-world numbers. Just synthetic poopoo.

I think I read the article correctly, but I think it only talks about how they introduce "chaos engineering," I didn't recall them talking about how they actually handle a volume of traffic like 80k req/s.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by baby_souffle on Tuesday September 05, 2023 @05:40PM (#37398140)
> I would love to know what software stack, hardware, and uplink connections in total they utilize to accomplish a real-world 80k request per second throughput. How many instances do you guys think Amazon runs for its primary e-commerce front-end stack? In total, and per region? Assuming they have a multi-region rollout. > But I never see anyone talk about real-world numbers. Just synthetic poopoo.

The number probably changes all the time based on load. They'll never release these details because it's a competitive advantage to have the "how popular are they in $place at $time-of-day" data private.

When they do share numbers, it'll always be the most flattering and devoid of any context beyond the "wow" factor.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by andrewmcwatters on Tuesday September 05, 2023 @05:46PM (#37398204)
I'm not sure it's the biggest deal in the world, plus real-world market presence data is regularly detailed in shareholder reports for various companies.

You could take low-end instance specifications and standard industry stacks and extrapolate forward how many instances they might need to maintain at a maximum, but those numbers are going to be off.

Are they running 400 low-end front-end instances across the globe? Probably, (plus the 40 or so other services they claim to need, multiplied by region count at a minimum) and that would actually be well below realistic and reasonable for a company like Amazon. You can take a bunch of regional instances that handle roughly 200 req/s and make that work.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by tacozilla on Tuesday September 05, 2023 @06:48PM (#37398880)
While I can understand the cynicism, the real answer is a lot closer to something much more boring, which is most people just don't care about the actual numbers, and if they were to release them, while interesting to a small few, generally no one would actually care.

There's also a common misnomer that Amazon.com is somehow just this one giant app running on a set of servers, which isn't remotely how it's actually deployed, and that's before we spend time arguing whether a team's instances even count as "primary e-commerce front-end stack" or not. :P

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by hughesjj on Wednesday September 06, 2023 @01:55PM (#37408596)
Also their "stack" includes various degrees of AWS (maws, naws, and I'm sure a bunch of snowflake situations innumerable here, I mean do you count corpinfra? Controls?)

Not to mention all the data center logistics

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by tacozilla on Tuesday September 05, 2023 @06:45PM (#37398838)
Amazon doesn't really have a "primary e-commerce front-end stack" in any concrete sense. They have hundreds/thousands of teams that deploy bits and pieces to a massive pipeline that ultimately makes up what you see on Amazon.com, but each team can have their own infrastructure backing things. Some teams might run everything off a dozen low-end EC2 instances while another sibling team has 3k+ instances; it's really all over the place, and that's ignoring specific events like Black Friday or Prime Day, etc. where teams need to prescale things in advance.

Source: Worked at Amazon/AWS for almost a decade.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by andrewmcwatters on Tuesday September 05, 2023 @07:45PM (#37399400)
Thanks for the neat insight!
Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by superfrank on Tuesday September 05, 2023 @06:56PM (#37398954)
I used to work on a system that did about 55k/sec at peak. The service was internal it was only handling grpc calls which were coming from inside our VPC and it was written in Go. It's main job was was reading and writing to an SQL db that was sharded across 3 or 4 of the biggest instances AWS offered at the time (2017ish).

Everything was Dockerized and I think we were using Docker Swarm for container orchestration. I don't remember the specs for each box, but we had auto scaling set up so at peak we'd hit a little over 200 containers.

Looking back now, I'm sure we could have gotten much better performance out of that service, but the team was young and inexperienced and throwing money at the problem was an easier solution.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by andrewmcwatters on Tuesday September 05, 2023 @07:50PM (#37399443)
Sounds about in the ballpark I would expect, though!
Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by yazaddaruvala on Tuesday September 05, 2023 @07:03PM (#37399012)
> If it's the real-deal, and not like people saying "Bun.js can serve 65k req/s+ (cough cough to localhost,)" that's impressive.

Not all req/s are made the same.

Amazon search is made of 100s of services, and Amazon's search page loads 20 products per page, that means 80k search req/s translates to 1.6 MM product API req/s for example.

FWIW a search request at Amazon hits roughly 100 unique search clusters (this of ElasticSearch clusters - but its not ES), with different product groupings in each cluster. Each cluster is made up of 1000s of nodes running Lucene (think similar to ES shards). This is just for the "match set", i.e. which products to return.

Then there are services to re-sort those matched products based on popularity, likelihood of purchase, etc. Think giant ML models. Then there are product lookups. Before all of this, there is Query analysis to simplify/improve the query (think giant ML models) to classify "Apple" into electronics vs groceries based on the other keywords and your current context.

Meanwhile, Bun.js is talking about 65k "hello world" type req/s. The compute per req is magnitudes different.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by Tomis02 on Tuesday September 05, 2023 @08:17PM (#37399670)
> Not all req/s are made the same. > Amazon search is made of 100s of services, and Amazon's search page loads 20 products per page, that means 80k search req/s translates to 1.6 MM product API req/s for example.

That's their problem, no? Nobody's forcing them to have an architecture where a request propagates to hundreds of services.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by dmoy on Tuesday September 05, 2023 @08:37PM (#37399852)
> That's their problem, no? Nobody's forcing them to have an architecture where a request propagates to hundreds of services.

Well, Jeff Bezos circa 2002 or so did:

https://news.ycombinator.com/item?id=3102800

It's hard to remove that ethos now

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by hughesjj on Wednesday September 06, 2023 @01:52PM (#37408565)
And thank God he did, amazon would have direct without the SOA enforcement.

Scale issues are emergent issues. It's a phase transition.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by txcwpalpha on Tuesday September 05, 2023 @08:54PM (#37399981)
Why is it anyone's "problem"? Nobody said they're being forced to do it this way - just that they are. And I guarantee that there are thousands of other companies out there that have an API-fanout model as well, and might be interested in how Amazon does it.

I don't get the hostility around this article. Nobody is forcing you to read it or to do it this way. If your system is architected in a different way where you can run your whole system on a single instance, then good for you! But Amazon presumably doesn't have that luxury, and others may not either.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by yazaddaruvala on Tuesday September 05, 2023 @09:10PM (#37400125)
> That's their problem, no? Nobody's forcing them to have an architecture where a request propagates to hundreds of services.

I mean, physics kinda is.

Just the volume of data that needs to be hosted, needs multiple nodes. ElasticSearch has some good general documentation of search engines if you want to learn more. In Amazon's case, a general query will hit a fanout of about 10,000x nodes - I wasn't even counting that fanout because it is all technically 1 service.

Meanwhile, Bun.js (no offense to Bun) is built for IO-bounded workloads and 65k req/s is great for that. However, executing the required Natural Language Processing (i.e. multiple ML models) would result in an exhausted CPU (even if Bun could distribute the compute across cores or compute the ML inference on a GPU). I'd be willing to bet even on a great CPU it gets throttled at 10 req/s (at most 100 req/s).

This really isn't some "They should have just done it all in Postgress, Bun.js can just use a nice ORM and be IO-bounded" type situation - which is a philosophy I very much agree with for 99.9999% of usecases.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by NBJack on Tuesday September 05, 2023 @09:37PM (#37400365)
I suspect it grew into that. Amazon has been around for almost 30 years. That's a long time to incrementally change a service ecosystem.
Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by yathaid on Wednesday September 06, 2023 @05:50AM (#37403085)
My favorite kind of HN answer. 100% snark, 100% certain, 100% wrong.

So, instead of that, what would you have? A single, binary that makes multiple DB calls? Hmmm, let's see, some people have tried that and written extensively about the problems they faced doing that. Wait, one of them is actually a small e-commerce firm named after a larger river. Wonder what the issues were ...

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by Karrot_Kream on Tuesday September 05, 2023 @07:50PM (#37399448)
Having led API teams at a big tech where we handled similar (slightly lower) request numbers at the edge, I can tell you that the entire stack was engineered to be defensive and handle a certain amount of load. As other commenters have said, fan-out means that 80k qps at the edge means you're getting probably 10-100x that on some of the most heavily hit backend systems. A lot of the work we did was very aggressive caching and sharding. Autoscaling to handle load spikes.

Observability was our secret sauce. We would monitor everything. Our caches, NICs, our load balancers, etc. Cache hotspotting and DB problems were the problems that kept us up at night, though my teams didn't deal with much stateful data.

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by ilyt on Tuesday September 05, 2023 @08:11PM (#37399624)
Well, to get actual impact you'd need infrastructure-wide tracing and that's hard.

Like, you could hit a cache and serve 95% of page from it. Or hit some long path that will burn half a second on 20 servers in the backend to serve some big query

But yeah title is useless

Re:Any Day Can Be Prime Day: How Amazon Uses Chaos Engineeri... by hughesjj on Wednesday September 06, 2023 @01:57PM (#37408638)
I mean, coralmetrics+pmet has been doing that infrastructure wide tracing for decades (albeit being slowly replaced in spots now).

Back in 2014 they were still sharing a few years old (at that time) detail-level service call graph that had so many nodes and lines it looked like string art.