Earlier quoted context omitted.
Unfortunately, Rust is not a good choice for this kind of tricks. This is where Zig shines. In Rust, you can’t even use proper arenas, which can help a ton with allocations. Cloudflare started to pick Zig recently, for projects, that have memory constraints.
I'd like to know why I can't use arenas in rust? Especially considering that I have used them before in rust.
Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
161–170 of 306 posts
Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#162It is almost like nobody even thought during the design phase about what might happen down the road.
This is why so much software is bloated and often buggy. Just gets something that half-way works out the door ASAP and worry about the rest later (too often, never).
Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#163Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#164Why do people seem to think that optimization is something you only have to deal with once the software scales so much that 100s of TB of memory or disk space (or thousands of hours of processing time) are being wasted. It is almost like nobody even thought during the design phase about what might happen down the road. This is why so much software is bloated and often buggy. Just gets something that half-way works ou…
In the case of internet infrastructure I don't think there was anybody even up to the year 2000 who had any idea of how bit this was going to be. And even now we have IPV4 and lots of legacy to deal with. Cloudflare is not my favorite company, let's put it like that, but in this case they show how the sausage is made and I think that should be applauded. Much better than 'why were down again for X hours'.
Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#165Earlier quoted context omitted.
When I was first getting into software dev, I thought 'enterprise' meant 'industrial grade', 'powerful', 'high-performing'. Then I actually met some enterprise software, and realised that it means 'expensive', 'bespoke', 'one-off', and usually 'janky'.
Enterprise means it has SSO and a support contract
Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#166This is the right way to deliver software. Produce working product first, validate the idea, stabilize the business, start generating profit, and then you can start optimizing your costs. In fact optimization is by far the easiest part of the process because there are many system programming experts on this HN thread who consider these optimizations to be trivial.
Or optimize a bit earlier and prevent having to scale out to a bazillion systems.
Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#167These seem like some fairly standard approaches for reducing memory usage. I can't help to think that the approach of joining several distinct list into a single one in some way undercuts Rust's safety guarantees. If you previous had three distinct Vec objects, then Rust would guarantee that you can't index out of bounds. If you now put all those objects into a single Vec and rely on offsets, then you now open the do…
Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#168General theme: A programming language's native in-memory object format is typically optimized for random access, uniformity, and mutability (fields at fixed offsets, etc). Serialization formats for network or disk tend to be designed explicitly to be more compact. But you can design your own in-memory representation too, with the properties you need.
That’s the old school of thought. These days, designers of newer serialization formats realize that designing a more compact format doesn’t really buy much on modern CPUs and modern networks. See for example Cap’n Proto (whose inventor, kentonv, also works at Cloudflare) and flatbuffers.
Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#169How much is this in euro or do we measure money in ram now?
Re: Saving 100 terabytes of memory by optimizing 1.1.1.1's DNS cache
#170Earlier quoted context omitted.
I think the question is probably more along the lines of - why not do a database with 100 TB of storage/records instead of a cache? tomato / tomato.. especially with smart caching in front of database. 100TB of flash is a good bit cheaper than 100TB of memory
It's not 100TB of data. It's probably 50 GB of data on each of 2000 servers. Because it's a cache. What is the point of a central cache if it's as slow to access as the original data?