Better HN
topnewbestaskshowjobs
Log inSign up

codahale

1,027 karma · joined Jun 13, 2008 (18y ago) · 143 submissions

Submissions

comment 16y ago · link · parent

Would that I had more upvotes for this.

The actual cutting edge of event-driven server architecture[1] looks something like this:

    server = do {
      sys_call_1;
      fork client;
      server;
    }

    client = do {
      sys_call_2;
    }
(And even then it has marginal benefits in terms of throughput and latency compared to threaded implementations.)

[1] Li and Zdancewic. Combining events and threads for scalable network services. Proc. 2007 PLDI (2007).

comment 16y ago · link · parent

Awesome. A journal article authored by people who don't know how to fight, summarized by a person who doesn't know how to fight or do basic science.

comment 16y ago · link · parent

At this point, neither Cassandra nor Redis are in the critical path of their timeline service.

comment 16y ago · link · parent

I see absolutely zero details about the actual configurations of either system. No replicability means it's just another opinion paper.

comment 16y ago · link · parent

By that token, all security advisories are just advertisements for the security researchers' services.

comment 16y ago · link · parent

That doesn't sound unreasonable, no -- at some point in the future, Scala's hash array mapped trie will be robust and highly optimized. If your plan is to wait until then, you might be able to speed things up by helping them out yourself.

In the meantime, I benchmarked Yoink's PeristentHashMap against 2.8.0.RC2's immutable.HashMap by a) creating a map of 100,000 sequential keys and then removing them all, and b) creating a map of 100,000 random keys and then removing 100,000 random keys. In the first case, Yoink was 20.7041% (±1.83693%) faster. In the second case, Yoink was 24.7834% (±4.17055%) faster. (Student's t distribution, 95% confidence interval, source is in src/test on the GitHub project and I used ministat for the statistical analysis [a cross-platform port of which is also available on my GitHub page].)

So to summarize, I have a provably faster hash array mapped trie at almost zero cost right now because I spent a few hours with a "good learning experience."

comment 16y ago · link · parent

The hash array mapped trie was committed to trunk 3 months ago and was first released in 2.8.0.RC1 (which no one uses due to various bugs) and is now available in 2.8.0.RC2 (which very few people are using due to binary incompatibility).

In contrast, Clojure's PersistentHashMap dates back to 2007 and was in both the 1.0 and 1.1.0 releases.

comment 16y ago · link · parent

I invite you to benchmark the two.

I'm also slightly confused as to why you think reusing stable, proven, and reviewed data structure implementations is a "good learning experience" as opposed to being SOP.

comment 16y ago · link · parent

I've seen java apps commonly take up a whole rack of servers, not just one

Ok, and I've seen Java apps not do that. Argument by anecdote is bankrupt.

comment 16y ago · link · parent

You know, you can set a maximum heap size for JVM processes. It defaults to 1/4th of the physical memory or 1GB, whichever is the smaller.

comment 16y ago · link · parent

And yet the nerve impulses which caused the muscles in your arm to contract left your brain about 500ms before you became aware of deciding to raise your arm. (http://www.ncbi.nlm.nih.gov/pubmed/6640273) Additionally, the mechanisms which sent that nerve impulse were spinning up for up to 10s before that (http://www.nature.com/neuro/journal/v11/n5/abs/nn.2112.html).

The you that lifts your arm and the you which feels like it decided to lift your arm are on different schedules.

comment 16y ago · link · parent

Oh, ok. So it takes making predictions to quality as real science.

Here's a real prediction, with actual confirming evidence: giving someone with a high MADRS score an SSRI will reduce their score.

That's beyond seeing and naming depression, it's beyond recording patients' reactions to SSRIs, it's beyond spotting patterns in their reactions, it's even beyond making falsifiable theories about its mechanism of action. It's making predictions which are confirmed on a statistically significant basis.

Does this mean you think psychiatry has the same epistemological standing as physics?

comment 16y ago · link · parent

You have got to be kidding. 150-300 years?

Agriculture dates back to at least ~10,000 BC (the "Neolithic revolution"). Effective farming (i.e., not dying of starvation) requires planning for changing weather conditions. If you think Neolithic farmers didn't have a vested interest in detecting patterns in weather cycles, you're sadly mistaken.

Hell, the term "meteorology" was coined by Aristotle... in a book he wrote... called Meteorology... in 350 BC.

comment 16y ago · link · parent

The reason we know where Pluto will be in 9 years is that we've been watching the solar system for two thousand years.

How long do you think people have been watching the weather for?

comment 16y ago · link · parent

Seriously. No one jumps all over NASA yelling about how the science "isn't in yet" when they want to send a probe out to where Pluto will be in 9 years.

comment 16y ago · link · parent

They might. I don't know. They didn't ask me for help getting it tuned.

comment 16y ago · link · parent

The bcrypt algorithm has salting built-in.

comment 16y ago · link · parent

They're two completely different things. AES is an encryption algorithm. bcrypt is a special-purpose hash algorithm.

If you're confused, I'd highly recommend Practical Cryptography by Niels Furguson and Bruce Schneier: http://www.schneier.com/book-practical.html

It will give you much better advice than the internet will.

comment 16y ago · link · parent

I should have been more precise in the article. Here:

A system which uses an adaptive hash function like bcrypt is ~6 orders of magnitude less effed in the event of a compromised database than a system which uses a standard hash algorithm and a salt, ceteris paribus.

I would hope you agree that those ~6 orders of magnitude could well be the difference between "not noticeably effed" and "profoundly effed."

comment 16y ago · link · parent

Awww. :(

comment 16y ago · link · parent

You're asking about the relative merit of two hash functions, one of which allows your attacker to test a candidate password in 1 millisecond, the other of which allows the same in less than 1 nanosecond. Using the latter provides your attacker with a 1,000,000x productivity boost. Personally, I'm not that generous.

As far as CPU exhaustion, there are some huge sites which use bcrypt (like, in the top 10)[1]. It is not a problem, provided you choose your work factor carefully.

As far as complex passwords, use them. Try to get your users to use them. But it's an orthogonal concern: your attacker will still be able to work their way through the gigantic keyspace of your monster passwords at 1,000,000x the rate of what they could do if you'd have used bcrypt.

[1] Just looked this up. Not the top 10, but the top 15 for sure.

comment 16y ago · link · parent

Toss it up on GitHub, man.

comment 16y ago · link · parent

Uh. All of the current SHA-3 candidates are as fast or faster than SHA-1. That's one of the contest's design goals:

NIST expects SHA–3 to have a security strength that is at least as good as the hash algorithms currently specified in FIPS 180–2, and that this security strength will be achieved with significantly improved efficiency.

http://csrc.nist.gov/groups/ST/hash/documents/FR_Notice_Nov0...

comment 16y ago · link · parent

He's implying that using bcrypt (and other iterative hash functions like PBKDF2 and scrypt) raises the cost of mounting a dictionary attack compared to commonly-used and -recommended hash algorithms like SHA256.

Which, uh, is an objectively verifiable fact.

comment 16y ago · link · parent

Also, you point out that "successfully discouraging your users from using a crappy password has much better repercussions." This is true, and I'm curious to know how you personally achieve this with your users, given that the vast majority[1] of users choose spectacularly crap passwords.

[1] http://www.imperva.com/docs/WP_Consumer_Password_Worst_Pract...

comment 16y ago · link · parent

I'm familiar with cperciva's scrypt, and I think it's a great solution. That said, I've only seen C and Ruby bindings for it.

I'd love to recommend its use over bcrypt, as memory constraints are much more expensive than computational constraints, but recommending something most developers don't have access to would result in more weak hashing schemes in production.

comment 16y ago · link · parent

I'm guessing you haven't read Provos and Mazières' USENIX paper. In the design considerations, they say:

In general, a password algorithm, whatever its cost, should execute with near optimal efficiency in any setting in which it sees legitimate use, while offering little opportunity for speedup in other contexts.

PBKDF1 and PBKDF2 both rely upon general-purpose hash functions, which are much faster in dedicated computing environments such as FPGA or GPU clusters. The Eksblowfish algorithm at the heart of bcrypt is extremely resistent to optimization.

This is crucial for password storage, since if a CUDA implementation is 3-4 orders of magnitude faster than the implementation your application uses, you've just chipped off a huge chunk of the advantage offered by your hash function.

comment 16y ago · link · parent

I'm curious to know why you think innovation in the security domain will come from web developers working on lolcat apps and not, say, cryptographers.

comment 16y ago · link · parent

Foiled again! Curse you, Ptacek!
12345