152 points · by TheGuyWhoCodes · 6y ago · 89 comments
[ec2-user@ip-10-0-42-228 ~]$ lscpu
...
L1d cache: 64K
L1i cache: 64K
L2 cache: 1024K
L3 cache: 32768K
Find a deep dive on the cache and memory micro-architecture here: https://www.anandtech.com/show/15578/cloud-clash-amazon-grav...EDIT: meaning that a larger sized cache wouldn't necessarily deliver better performance (though I think in this case the architectural differences do favor Graviton making better use of cache)
I am hoping Apple does this with their desktop chips: basically take the fastest phone/tablet processor, give it better thermals, and pump up the cache. That would be an easy path to beating Intel on a laptop.
Graviton2 doesn't even have a particularly large total amount of cache, the only part of the cache system that's bigger than both AMD and Intel is the L1D. L1I is the same as AMD, L2 is same as Intel, L3 is smaller than both (talking about current-gen server chips). That L1D can indeed make a big difference in certain workloads though.
The L3 is actually pretty small for how many cores there are, ARM recommends 1-2MB/core for the N1 cores in the Graviton2 and it has 512KB/core. AMD has 4MB per core in Zen2 albeit with a slightly weird setup where the L3 is localized to 4 core clusters.
We were pulling in millions of emails from the past few years, so we had to do a larger size RDS and we were killed on the IO charges.
We are now just on a medium sized EC2 server.
Do you have suggestions for better ways of doing this?
Here, for example, Amazon's own Aurora MySQL is not available on Graviton processors.
It is not surprising at all that supported products are going to be slow to support other architecture.
I had to take a peek at a friend's Cavium's ThunderX2 kernel issue a while back, which stops having concurrency when release build is swapped with a debug build.
So the specific part that drives you crazy is "Atomic can be reordered with stores - Y" for ARM and N for X86_64.
And changing the compiler optimization flags can turn on/off this bug.
It's like Amazon has narrowly tested specific features on specific hardware sizes.
Basically, although I'm sure someone will shout me down for this, x86 provides something close to sequential consistency among loads and stores even for concurrent programs, whereas ARM and POWER provide almost no kind of order for loads and stores without barriers. High-level languages like C++ do not really hide this problem. It is very easy to write a concurrent C++ program on x86 that appears to work in practice but never works on ARM.
Amazon Aurora support for AWS Graviton2 powered instances is still in development. I'll share your comments with the team, since direct customer feedback helps us prioritize new launches. If you have an account manager, please also let them know to make a note on your specific interest.
Do specific customer requests change the development trajectory significantly?
For Amazon Aurora, there are a lot of additional features in development, including offering Graviton2-powered instances. I expect that will deliver price and performance benefits for customers, but it's not the only benefit that's in the works.
For the container systems e.g. ECS, EKS, Fargate they have an open roadmap where they drive much of the direction from the community:
https://github.com/aws/containers-roadmap
For others it's completely closed off. At my last company we spent tens of millions a year with AWS and they never listened to us. The account managers have zero pull.
[1] https://www.percona.com/blog/2019/12/19/the-benefits-of-amaz...
One example of a patch that can help with MySQL performance on Graviton2 processors is enabling the Large System Extension atomic operations. You can find our pull request for enabling that here: https://github.com/mysql/mysql-server/pull/302
Unfortunately it seems that their CLA bot auto-closed the submission. Thank you for your comment here on HN, because it prompted me to go check on this PR and it led me to this discovery.
[edit] See also the discussion here about compiler flag defaults for PostgreSQL, to provide optimizations while retaining compatibility for Arm processors without LSE: https://www.postgresql.org/message-id/flat/099F69EE-51D3-421...
Not as much as one would hope. x86 is a very complex architecture.
Note that most cellphones run ARM, there are many years of compiler optimizations as well.
Compilation, yes, runtime for DBs? Unlikely.
1. These offer an excellent price to performance ratio for an egress firewall like purpose because of low instance pricing and high network throughput.
2. For our stack written in C and Rust, any performance penalty isn't noticeable. It's basically a NAT gateway filtering by hostnames for TLS & SSH outbound.
ESNI (now Encrypted Client Hello: https://tools.ietf.org/html/draft-ietf-tls-esni-08) is still in draft.
v1 of the firewall that is currently published ignores the extension but will deny in case SNI is absent.
v2, due in a couple of weeks, will actively seek presence of any of ECH extensions and deny them. This is to prevent domain-fronting style of exfiltration attempts. We expect HTTP Clients in the enterprise to not have moved over to ECH any time soon. However, the firewall has a lot of checks and balances built-in to mitigate this in the future when it arrives.
We went live with R6g (Redis) and R6gd/T4g (ES) instances at the beginning of the month. We were coming from an ancient cluster from AWS managed ES (2.3) and using their i3 elasticsearch instances so it’s been an Apples to Oranges comparison.
We are running T4g/C6g/R6g K8s clusters for web servers.
We do still have Postgres on R5 instances but I’m interested to check out R6g there since we can do a direct comparison
Specifically around hyper threading, my understanding is c6 don’t have “vCPUs”, and just have “CPUs“, so the effective number of cores doubles. Did you find similar throughput (in terms of Elasticsearch Search/Write TPS) between a virtual and real core?
Another advantage of the Graviton processors is 50% more dedicated storage compared to equivalent Intel/AMD instances. To get enough storage we would have had to bump up to r5d/r5ad.24x or metal which when testing we also saw more “jitters” in latency on the long tail. Despite the x86 instances being larger they traded blows in different tests we had, aggregates were one thing that x86 easily beat out ARM but a lot of our aggregates come from another data source so it wasn’t a deal breaker. Overall we are happy with performance, compared to old stack we are at around 10% of the cost and I think our savings was more than 2x compared to x86 after locking in some rates. R6gd.metal (16x) vs R5d.metal (24x)
What's the developer experience here - I have been considering cross building a docker vm for arm and deploying it. But I wasn't sure how comfortable is it.
We use python, if that matters
I would say I’m the bridge between the infra/DevOps teams and our back end team of 12 people and as far as everyone else on the team is concerned it “just works”. Still waiting for the first big time it doesn’t
128 or more cores would spark my interest, especially on RDS. Graviton2 is built on Neoverse N1 which already has a reference design featuring 128 cores. N2 supports 192 cores.
https://aws.amazon.com/rds/postgresql/pricing/#Reserved_Inst...
Untold story: open source and CI is now sufficiently pervasive, that recompiling for ARM just isn't a big deal. Gone are the days of painful recompiles.
tl;dr: remember your first experience with SSD vs HD? that's what the g2 performance boost feels like.
https://aws.amazon.com/blogs/aws/new-t4g-instances-burstable...
Pricing was available for Postgres, but I didn't check other database types