HNHacker News
TopNewBestAskShowJobs

asymptotic

409 karma · joined March 21, 2011

https://asim.ihsan.io/ https://github.com/asimihsan

[ my public key: https://keybase.io/asim; my proof: https://keybase.io/asim/sigs/ghOttQMhTUWDaeBj1z7Ebq-7KDe5wAATYO8RQ1QGUBs ]

submissionscomments
asymptotic··on Iran rounds up thousands in mass arrest campaign after crushing unrest
https://archive.ph/LzV2M
asymptotic··on InfluxDB Cloud shuts down in Belgium; some weren't notified before data deletion
At AWS, the hierarchy of service priorities is crystal clear: Security, Durability, and Availability. In that order. Durability, the assurance that data will not be lost, is a cornerstone of trust, only surpassed by security. Availability, while important, can vary. Different customers have different needs. But security and durability? They're about trust. Lose that, and it's game over. In this regard, InfluxDB has unfortunately dropped the ball.

Deprecation of services is a common occurrence at AWS and many other tech companies. But it's never taken lightly. A mandatory step in this process is analyzing usage logs. We need to ensure customers have transitioned to the alternative. If they haven't, we reach out. We understand why. The idea of simply "nuking" customer data without a viable alternative is unthinkable.

The InfluxDB incident brings to light the ongoing debate around soft vs. hard deletion. It's unacceptable for a hard delete to be the first step in any deprecation process. A clear escalation process is necessary: notify the customer, wait for explicit acknowledgement, disable their APIs for a short period, extend this period if necessary, soft delete for a certain period, notify again, and only then consider a hard delete.

The so-called ["scream test"](https://www.v-wiki.net/scream-test-meaning/) is not a viable strategy for a cloud service provider. Proactive communication and customer engagement are key.

This incident is a wake-up call. It underscores the importance of data durability and effective, respectful customer communication in cloud services and platform teams. Communication is more than three cover-your-ass emails; it's caring about your customers.

asymptotic··on Investigating the impact of HTTP3 on network latency for search
I misread the article when it stated:

> Traffic regularly exceeded 1,500 queries per second (QPS) at peak times

It may be quite cost prohibitive to use a managed service like AWS Global Accelerator.

asymptotic··on Investigating the impact of HTTP3 on network latency for search
While HTTP3 does provide some improvements, it's clear that further optimizations are needed, particularly for users in Europe and Asia.

One potential solution that hasn't been discussed much here is leveraging AWS managed services like AWS CloudFront or AWS Global Accelerator. It's worth noting that Dropbox's website already uses AWS CloudFront, so they are already leveraging AWS in some capacity. Based on my cost calculations, using AWS CloudFront would cost around $40k a month, while AWS Global Accelerator would be around $22k a month.

As of August 22, 2022, AWS CloudFront supports terminating HTTP/3 in a Point of Presence (POP), which could potentially help with the latency issues Dropbox is facing. AWS Global Accelerator, on the other hand, is designed to improve the performance of applications by terminating UDP/TCP as close to users as possible then routing user traffic through the AWS global network infrastructure. This could help reduce latency by ensuring that user traffic is routed through the most optimal path, even if the user is located far from a Dropbox data center.

It's hard to estimate what the potential latency reduction of using e.g. AWS Global Accelerator is, especially at higher percentiles. However, using https://speedtest.globalaccelerator.aws/, and assuming symmetry, my connections to Asia are 35-40% lower latency.

Of course, there are trade-offs to consider when using managed services like AWS CloudFront and AWS Global Accelerator. While they can provide significant performance improvements, they also come with additional costs and potential vendor lock-in. However, given the scale of Dropbox's operations and the importance of providing a fast, reliable search experience for their users, it may be worth exploring these options further.

---

Cost estimates

Assumptions:

    1. Dropbox's peak traffic is 1,500 queries per second (QPS).
    2. Average data transfer per query is 100 KB.
    3. 50% of the traffic comes from North America, 25% from Europe, and 15% from Asia (remaining 10% from other regions, for pricing purposes put it into Asia's calculations).
---

1) AWS CloudFront cost estimation:

    Data transfer:
    - North America: 1,500 QPS * 0.5 * 100 KB * 60 seconds * 60 minutes * 24 hours * 30 days = 194.4 TB  
    - Europe: 1,500 QPS * 0.25 * 100 KB * 60 seconds * 60 minutes * 24 hours * 30 days = 97.2 TB  
    - Asia: 1,500 QPS * 0.25 * 100 KB * 60 seconds * 60 minutes * 24 hours * 30 days = 97.2 TB

    Data transfer cost:
    - North America: 194.4 TB * $0.085/GB = $16,524
    - Europe: 97.2 TB * $0.085/GB = $8,262
    - Asia: 97.2 TB * $0.120/GB = $11,664

    Total data transfer cost: $16,524 + $8,262 + $7,006 = $36,200

    HTTP requests:
    Total requests: 1,500 QPS * 60 seconds * 60 minutes * 24 hours * 30 days = 3,888,000,000

    Using the updated AWS CloudFront pricing (as of May 22, 2023):
    - HTTP requests cost: 3,888,000,000 * $0.0075/10,000 = $2,916
Total estimated monthly cost for AWS CloudFront: $36,200 (data transfer) + $2,916 (HTTP requests) = $40k

---

2) AWS Global Accelerator cost estimation:

    Data transfer:
    - Total data transfer: 194.4 TB (NA) + 97.2 TB (EU) + 97.2 TB (Asia) = 388.8 TB

    Using the updated AWS Global Accelerator pricing (as of May 22, 2023):
    - Data transfer cost (averaged across regions): 388.8 TB * $0.035/GB = $13,608
    - (Also need to add EC2 egress cost, 388.8 TB * $0.02/GB = $7,776
    - Total data transfer cost = $21,384

    Accelerator:
    - Assuming 1 accelerator with 2 endpoints (1 for HTTP/2 and 1 for HTTP/3)
    - Accelerator cost: 1 * $18/accelerator/day * 30 days = $540
Total estimated monthly cost for AWS Global Accelerator: $21,384 (data transfer) + $540 (accelerator) = $22k
asymptotic··on Google Cloud region currently down due to water intrusion
I’m familiar with Lambda and DynamoDB. When I left in 2022 they both had strong automated or semi-automated AZ evacuation stories.

I’m not that familiar with S3, but I never noticed any concerns with S3 during an AZ outage. I’m not at all familiar with Aurora Serverless or ECS.

For all AWS services you can always ask AWS Support pointed, specific questions about availability. They usually defer to the service team and they’ll give you their perspective.

Also keep in mind that AWS teams differentiate between the availability of their control and data planes. During an AZ outage you may struggle to create/delete resources until an AZ evacuation is completed internally, but already created resources should always meet the public SLA. That’s why especially for DR I recommend active-active or active-“pilot light”, have everything created in all AZs/regions and don’t need to create resources in your DR plan.

asymptotic··on Google Cloud region currently down due to water intrusion
When I worked at AWS there was a similar scenario in eu-west-2. There was a fire in one of the availability zones (AZs). The fire suppression system kicked in and flooded the data center up to ankle or knee height. All the racks were powered off and the building was evacuated for hours (I don't remember the duration of the evacuation) until the water was pumped out.

But for the service team I worked for, our AZ-evacuation story wasn't great at the time and it took us tens of minutes to manually move out of the AZ, but at least there wasn't a customer-visible availability impact. Once we did it was just monitoring and baby-sitting until we got the word to move back in, I think it was 1-2 days later.

If you operate on AWS you work with the assumption that an AZ is a failure domain, and can die at any time. Surprisingly many service teams at AWS still operate services that don't handle AZ failure that well (at the time). But if you operate services in the cloud you have to know what the failure domain is.

asymptotic··on How Discord supercharges network disks for extreme low latency
In a technical blog or dashboard I like to see

1) avg mean (for throughput estimates), 2) p50 (typical customer / typical load), 3) p90 / p99 / p99.99 (whatever you think your tail is) 4) p100 (max, always useful to see and know, maybe p0).

Or throw in a histogram or kernel density estimate, sometimes there are really interesting patterns.

I’ve never seen a technical blog give such traffic or latency details though.

Edit: reading other comments, please do not read this as diminishing this blog post or Discord, great clear writing and impressive solution to an interesting problem.

asymptotic··on Log4jmemes.com: for those of us that need a laugh
If you walk as if you’re happy, talk as if you’re happy, and quack like a happy person, then you are happy.

This is the Way.

asymptotic··on Monoio – A thread-per-core Rust async runtime with io_uring
> the best you can do is write a thread pool that spawns a Tokio LocalSet to run !Send futures

Can you go into this a bit more or provide a code reference? I'm new to writing async Rust code and am interested in this idea.

asymptotic··on Show HN: My wife is pregnant; naturally I made a baby-name app to prepare
Congratulations! I did the exact same thing; made an app to help name my first child.

I've slowly developed a method which incorporates 1) culture, 2) popularity in different countries, and 3) pronunciation of names and attempts to recommend you names based on names you like. It kind of works, it's taken a lot of tuning to make it output something sensible. It's specifically designed to attempt to combine cultures together, which is a top request from customers I identified.

I've been working on releasing the app for a while. If you're interested in helping me test it before its release this month please feel free to sign up here:

https://www.reddit.com/r/namenerds/comments/qge6t9/im_lookin...

I will also look at this thread's comments closely before launching.

asymptotic··on Pressing YubiKeys
FWIW Amazon / AWS also use YubiKeys.
asymptotic··on Slack Incident Resolved – Degraded service affecting multiple features
https://docs.aws.amazon.com/ram/latest/userguide/working-wit...

“To identify the location of your resources relative to your accounts, you must use the AZ ID, which is a unique and consistent identifier for an Availability Zone. For example, use1-az1 is an AZ ID for the us-east-1 Region and it is the same location in every AWS account”

So each separate AWS account will have a different AZ name that maps to use1-az1, but use1-az1 is a region-wide constant.

asymptotic··on Toddlers who use touchscreens show attention differences
I haven’t read the paper. But if the researchers were bringing in children regularly for testing involving eye tracking equipment, why not also test their ability to manipulate physical objects, recognize faces, and track faces? That all seems like low hanging fruit.
asymptotic··on Building an online community around learning from incidents (2019)
There is a quote from Jeff Bezos: "Good intentions never work, you need good mechanisms to make anything happen.". Hence at Amazon (ideally) any suggestion that a manual step or bureaucratic approval could improve a process is always naturally followed up by “But what happens when good intentions fail? We need a plan for a mechanism”. At least this is the theory, and how Amazon and AWS avoid accruing manual steps with no plan to automate them.
asymptotic··on Serverless LAMP stack
You are correct, I misread this.
asymptotic··on Serverless LAMP stack
API Gateway came out with a cheaper variant (called HTTP APIs, admittedly a poor name) that is $1 per 300 million requests (114 requests per second for a month): https://aws.amazon.com/api-gateway/pricing/

You can also hook up an Application Load Balancer to Lambdas if that works for you: https://aws.amazon.com/elasticloadbalancing/pricing/

asymptotic··on How we use Rust in our mobile SDK
I successfully used Rust to create a shared library in a Flutter project that works on both iOS and Android. So far I've only published the iOS app: https://apps.apple.com/us/app/ezmempass/id1490538369

I heavily relied on the following blog post: https://dev.to/robertohuertasm/rust-once-and-share-it-with-a...

Overall it's painful to set up and requires knowledge of the native platform (XCode/Swift, Android Studio/NDK/Kotlin), but overall it works and it was fun getting it working.

I'm happy to answer more questions about it, I've been meaning to write up the experience and details.

asymptotic··on The good parts of AWS: a visual summary
I agree that AWS doesn't yet provide a clean all-in-one package for static website hosting. I think AWS Amplify Console [1] is the current official "all-in-one" service but I haven't used it.

With the recent GA of AWS CDK [2] I would say that it is getting more and more possible to define your own development workflow that is tailored to your own static website hosting needs and better than just raw S3. AWS CDK is still difficult to use with some rough edges, and I know that setting up e.g. a CodePipeline and CI/CD is difficult.

Here is the CDK example for hosting a S3 origin + CloudFront CDN + custom TLS certificate + CloudFront invalidation on deployments static website [3]. Here is my personal version of it combining Hugo that took me a day to set up [4]. Still complicated, lot of rough edges, but offers a pleasant dev experience [5], I haven't yet built up a CI/CD pipeline.

Disclaimer: I work for AWS but my views are my own.

[1] https://aws.amazon.com/amplify/console/

[2] https://aws.amazon.com/cdk/

[3] https://github.com/aws-samples/aws-cdk-examples/blob/master/...

[4] https://github.com/asimihsan/asim_ihsan_io/blob/master/cdk/s...

[5] https://github.com/asimihsan/asim_ihsan_io/blob/master/READM...

asymptotic··on [dead]
When would you want to block as you insert tasks into an ExecutorService already executing N concurrent tasks? Why not use "newFixedThreadPool" and don't block but stil keep a maximum of N concurrent tasks? Honest question, not snarky.
asymptotic··on Quiver: Programmer's Notebook for OS X
If you're on Mac just create a sparse encrypted DMG using Disk Utility, put it into Dropbox, bam you're done. http://blog.fosketts.net/2011/07/05/mac-dropbox-encrypted-vo...

I prefer applications to focus on one thing and do it very well, and leave other orthogonal functionality to other applications or the OS to then do the other parts very well. In this respect Quiver is well designed, I tip my hat to the author.

asymptotic··on Amazon's customer service backdoor
I might be being pedantic, but the only mention of 2FA in the OP is:

"As a security conscious user who follows the best practices like: using unique passwords, 2FA, only using a secure computer and being able to spot phishing attacks from a mile away, I would have thought my accounts and details would be be pretty safe? Wrong."

Are you sure the author enabled 2FA on his Amazon retail account, or was it only enabled on his AWS account? The two systems do not share the same 2FA.

FYI I enabled 2FA on my Amazon retail account and when I called customer support they verified it. Once the verification failed and they refused to give me support.

Anyone else confirm a similar story with 2FA and support? Anyone willing to explicitly test this out?

asymptotic··on Amazon's customer service backdoor
You can register for domains through AWS Route 53 and it'll automagically register on Gandi with WHOIS protection and link it up inside Route 53. You then don't need to leave the AWS UI, it just seems like it works magically.

(I think this is true...I can't remember now actually).

asymptotic··on The Three Cultures of Machine Learning
For the deep learning vertex the OP states:

"At the right vertex, we have Breiman's know-nothing approach—high-capacity models like neural nets, decision forests, and nonparametrics that will fit anything given enough data. This is engineering with less science (see these remarks). Deep learning people cluster here."

The phrase "will fit anything given enough data" is misleading and not correct about cutting-edge machine learning methods. "Fit" is a useless term, and you will instead find people talking about "bias" and "variance".

For any supervised method (you know the intended outputs) you apply to predict data, there are three sources of error: bias, variance, and random. Random error is some irreducible unpredictability that cannot be modeled. Bias occurs from bad assumptions made by the model itself (e.g. maybe the model is too simple). Variance is sensitivity to small changes in the data the algorithm is trained on.

High bias means the model is too simple to capture all the variations in the data set. High variance means the model is too overfit on the data at hand and it is not successfully generalizing to unseen data. In real-world problems there is a direct tradeoff between bias and variance. Nevertheless the goal of any supervised learning model is to have both low bias and low variance.

By splitting off a big (~10-20%) chunk of all data available into a "test" set, training the model on the remaining "train" set, then evaluating it on the "test" set, it's possible to estimate the generalizability of the model on future "unseen" data by whatever metric you want. By additionally plotting learning curves one can crudely estimate whether we have high bias or high variance.

Hence the insinuation that machine learning blindly "fits" data as much as possible is false. Sophisticated (yet not difficult) methods both minimize and estimate the generalizability of the model to future unseen data (minimizing variance), inevitably at the cost of some notion of accuracy (increasing bias).

I think the OP's objection is that such ML methods "know nothing". This is a trivial statement to make. Rather, I would turn the objection on its head and ask "If our methods achieve acceptable estimated generalizability on unseen data, do we need to know anything?". This reminds me of Alan Turing's arguments about machines passing the Turing Test vs. "are they really human?".

asymptotic··on I ended up paying $150 for a single 60GB download from Amazon Glacier
I was also concerned about this when I was looking into Arq, so I wrote a cross-platform restoration tool that'll also work on Windows and Linux (not just Mac): https://github.com/asimihsan/arqinator

This is purely based on the author's excellent description of the format in his arq_restore tool: https://www.arqbackup.com/s3_data_format.txt

asymptotic··on Crustache is a fast C implementation of Mustache
I love the author's complete disregard for what science actually is, and instead using the word as a synonym for something unstable and dangerous:

    "WHO KNOWS WHATS GONNA HAPPEN. DO IT FOR SCIENCE."
It reminds me of Looney Tunes cartoons' impressions of chemistry sets and scientists. Fun is often the best response to the natural question: "but what if I just do...that?"
asymptotic··on Cutting-edge IT firms need experts in 'dead' languages

    While our universities are turning out very
    able graduates, well versed in the sexy new
    languages of Java, .Net and the like...
...BUWAHAHAHAHHA. The number of serious problems with this statement gave me a good chuckle.
asymptotic··on Exercises for a programmer sitting by the PC all day

    It's the knowledge that no matter how sucky a
    day turns out to be, I have done something to
    better myself.
This, a hundred times. Especially if you do this first thing in the morning; keep this up on regular basis and you can rest assured that you're part of a very small elite. Of course, I provide no evidence to back up my assertion; part and parcel with being an elitist.
asymptotic··on If you gaze into nil, nil gazes also into you
I can't comment on Ruby, but as the author decided to throw in a "...AttributeError in Python" reference I figure I have two cents to add.

Unfortunately the author is out of their depth. Why are they checking for specific attributes or assuming objects are an instance of a particular class? This violates the spirit of Python. Indeed, from the Python glossary:

    (Duck typing is a) Pythonic programming style that determines an object's
    type by inspection of its method or attribute signature rather than by
    explicit relationship to some type object ("If it looks like a duck and
    quacks like a duck, it must be a duck.") By emphasizing interfaces rather
    than specific types, well-designed code improves its flexibility by
    allowing polymorphic substitution. Duck-typing avoids tests using type()
    or isinstance(). Instead, it typically employs the EAFP (Easier to Ask
    Forgiveness than Permission) style of programming.
The author even misinterprets the first reference they provide! How outrageous is that? The author links to a blog comment as "These errors are one of the largest sources of bugs.", but the actual link _explicitly states_:

    The nowhere-near-ready-for-peer-review numbers I've seen suggest that
    something like 70% of bugs in Java manifest to the programmer as
    NullPointerExceptions.
These bugs _manifest_ using some language-specific exception, but clearly the actual bug is a different kettle of fish. It could be absolutely anything; poorly specified interfaces, well-specified interfaces that are called badly, some lower-level exception getting silently caught, inconsistent state. What does null, nil, None, NULL, whatever, have to do with this?
asymptotic··on The top 9+7 things every programmer or architect should now
I'll see your out-of-context quote and raise you the more subtle, sensible, and actually correct quote from Donald Knuth.

http://programmers.stackexchange.com/questions/39/whats-your...

        There is no doubt that the grail of efficiency leads to abuse. Programmers
    waste enormous amounts of time thinking about, or worrying about, the speed
    of noncritical parts of their programs, and these attempts at efficiency
    actually have a strong negative impact when debugging and maintenance are
    considered. We should forget about small efficiencies, say about 97% of
    the time: premature optimization is the root of all evil.

    Yet we should not pass up our opportunities in that critical 3%. A good
    programmer will not be lulled into complacency by such reasoning, he will be
    wise to look carefully at the critical code; but only after that code has been
    identified. It is often a mistake to make a priori judgments about what parts
    of a program are really critical, since the universal experience of
    programmers who have been using measurement tools has been that their
    intuitive guesses fail. (…)
asymptotic··on Erlang creator on how to get started and learning to program
There are several important threads that Joe Armstrong brings up that people are completely missing.

1) Typing in code directly into a shell necessarily implies you ignore all the tools and IDEs that many beginners clamour for. In fact, in my experience, coding into Notepad is a far superior learning experience than using an IDE. Nothing stands between you and your gaping ignorance, and you're forced to grapple with all the hideous details without pretty colours or intelligent auto-completion.

2) Typing in code offers you the chance to _deliberately type it in incorrectly and see what happens_. This is my favourite method of learning. Take a known good example, and say "Hmm, if I just do...that...to that line, what happens?". And then stare at the error output, immerse yourself in it. Just as with people, there is no better way of learning about a language, a tool, or an idea than when it is put under stress or unusual circumstances.

3) Tools necessarily abstract away some process, whereas when you're learning a new concept or idea the last thing you want is to shy away from the details of a process. This point reminds me of learning about long division in Year 7 at secondary school, and being forced to draw all these long arrows making clear which digits were going where. My maths teacher explained the rationale as "You have to go through all the motions, regardless of how silly or tedious they may seem now. Eventually you'll just naturally drop them to one side and not need them any more."

Page 1 of 4Next →