Amazon RDS on Graviton2 Processors
aws.amazon.com
aws.amazon.com
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.
Graviton2 has 64KB L1 caches and 1MB L2 cache per vCPU, with a 32MB LLC.
[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)
From Wikipedia (not the best source I know):
“L1 cache size unchanged at 32 KB (KiB) instruction and 32 KB (KiB) data cache per core.“
$ lscpu
Architecture: x86_64
Model name: AMD Ryzen 7 2700X Eight-Core Processor
L1d cache: 256 KiB
L1i cache: 512 KiB
L2 cache: 4 MiB
L3 cache: 16 MiBWe 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?
If you're willing to post a bit more details, I'm sure people could give you some more detailed options. You basically switched from a fully-managed database solution to a fully DIY solution, and I honestly think you might have just over provisioned the RDS instance. I'm willing to bet you can switch back to RDS and get all the benefits there while remaining within budget. You can get a 1-year reserved t3.medium RDS instance with 50 GB of storage for $40/month.
What was our specific server size and setup and costs with RDS? We were using db.t3.medium (1 CPU, 2 vCPU, 4GB RAM), we were using a DB cluster that has 2 instances db.t3.medium overall cost (~$118 monthly) And now with EC2? We are using c5d.xlarge (4 CPU, 20 ECU, 8GB RAM), we are using one instance c5d.xlarge overall cost (~$140 monthly) What was the big cost savings? Our main issue was in I/O (Read and write), we have very high I/O demand so we was paying for I/O and storage (~$600) and the second issue is CPU credit (~$90 monthly) so the total save is ($600+$90+$118)-$140= $668 per month.
Also EC2 performance is better than RDS because we get a very good cheaper than RDS server.
Note: RDS is configuration less and has support while if you want to use EC2 then you need a person to do configuration and support for DB on it.
Also, if you're doing such heavy IO, you might want to also look at I3en instances, which have fantastic IO using local storage.
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.
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.
On x86, sequential consistency isn't the implemented memory model, but rather total store ordering. Stores are buffered inside the core and the guarantee provided is that they'll appear to other cores in the proper order. On SC designs, all the cores have the same view of coherent memory all the time. In such a design, barriers aren't required and are lowered down to NOPs.
(only general-purpose processors that I know of that implement sequential consistency are NVIDIA's Tegra K1 (64-bit variant) and Tegra Xavier)
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.
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.
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...
This is the automated future that's already here.
I can imagine in the future:
Automated appeals bot: "Thank you for submitting your appeals letter for appealing the Case decision number XYZ. We will need you to submit a signature"
Wrongfully incarcerated person: "OK I will need to find time to get to another computer so I can submit my digital signature"
Automated appeals bot: "Please submit your signature. This is mandatory for all appeals"
Wrongfully incarcerated person: "OK after negotiating with the guards I finally got a computer where I can sign. I've signed my appeal application"
Automated appeals bot: "As we didn't get a signature from you in the set amount of time, your appeals application has been closed. The rest of the sentence will be executed."
Wrongfully incarcerated person is executed.
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] https://www.percona.com/blog/2019/12/19/the-benefits-of-amaz...
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)
> aggregates were one thing that x86 easily beat out ARM
This is actually a lot (most?) of our ES workload, so that's a really interesting detail.
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
So how do you bake your code in your base image ?
I'm referring to the developer experience here :
1. do you develop on x86 (mac, win, linux)?
2. Where do you build the arm docker images ? On your laptop - is it even possible.
3. Which build CI do you use to cross build arm?
2 and 3 I’ll answer to the “best of my knowledge” but on the professional level it’s something my team doesn’t handle (I do wish I knew more!). Features get merged to dev/stage/main and trigger blue-green rolling deploys based on whatever is configured. The deploy is handled through AWS CodeDeploy (not my choice, also not my teams jurisdiction) which handles ticket validation/testing/deploying to whatever k8s cluster/manual deployment rollover if needed.
I believe you can build ARM images from Docker, or at least I have a vague recollection of doing so for a Raspberry Pi, on a normal x86 machine
In my team we mandate testing docker images on local dev machines before rolling to production, so i was wondering how the cross-compiles, etc would work . But this is helpful. thanks!
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.
Should you be interested in the v2 preview, drop us an email (from your work email) or follow our LinkedIn page.
Regarding V1 of your product that ignores the encrypted SNI (ESNI) extension, do you mean it just allows all traffic using ESNI? If so, have you considered blocking malicious domains via DNS instead?
Happy to invite you to the v2 preview if you drop us an email (from your work email) or follow our LinkedIn page.
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