Better HN
topnewbestaskshowjobs
Log inSign up

automatthew

4 karma · joined Oct 31, 2008 (18y ago) · 19 submissions

Submissions

comment 11y ago · link · parent

Wells and driveways.

comment 11y ago · link · parent

Paging David Hume. David Hume. Has anyone seen David Hume?

comment 11y ago · link · parent

> I've been to standup meetings in close to a dozen different companies, ranging from the smallest startup to some of the biggest tech companies and never have I ever seen a standup meeting end on time. NEVER. I don't think it actually happens.

It's easy to sabotage standups in this manner by asking questions of others that you know will cause extended discussions. Especially on topics that have previously been "settled" by fiat.

comment 11y ago · link · parent

It was for LBJ.

comment 12y ago · link · parent

Hanlon's Razor is enemy propaganda.

comment 12y ago · link · parent

There used to be a proverb about this sort of thing. Something about being careful when eating finger foods.

comment 12y ago · link · parent

There's a reason that the safety razor became more popular than the straight razor.

comment 12y ago · link · parent

World Star Hip Hop will never be the same.

comment 12y ago · link · parent

Last time I tried to use the same public key for a second account, GitHub refused.

comment 12y ago · link · parent

Millenials can typing?

comment 12y ago · link · parent

Once upon a time, there was a town that had a severe rat problem. They imported a large number of cats, and soon the rats were gone.

Now the town had a cat problem. They imported a large number of dogs, and soon the rats were gone. But now they had a dog problem.

The town imported a large number of lions...

comment 12y ago · link · parent

Heartsuck?

comment 12y ago · link · parent

So we should choose the approach that gives us trivial attacks that reveal 64K straight out of Compton to the approach that may be slightly harder to defend against timing attacks?

comment 12y ago · link · parent

The npm source is crazy. Here's my favorite bugfix (bug being that the prepublish script simply wasn't running):

https://github.com/npm/npm/commit/2389525a1df6d20e780cca5887...

comment 12y ago · link · parent

Coincidentally, I just this week threw away one of his short story collections. In an introduction to a story, he gleefully quoted a nasty song one of his friends had written about the Lindberg kidnapping. Classy fucker.

comment 13y ago · link · parent

The problem isn't only with primitives, as I think you've mentioned before. Even assuming a browser provides turnkey symmetric crypto for arbitrary plaintext lengths, "content-controlled JavaScript" can still subvert the ostensible encryptions in subtle ways.

comment 14y ago · link · parent

The short answer is: Use of synchronous Redis calls made it easier to develop and to experiment with storage patterns.

Workers can be written in any language, which was another major design consideration. We have about a dozen types of worker right now; when we want to evaluate a new language, we can port just one. Alternatively, we can write any new worker types in an arbitrary language.

Thus we're not married to JRuby.

comment 14y ago · link · parent

The "queue" is merely a Redis list. Durable by default.

Redis PUB/SUB is not suited for the task queues we use, because any number of subscribers will receive the messages. We want to guarantee that only one worker will act upon each message.

comment 14y ago · link · parent

Regarding the architectural question:

We actually tested a few designs using m2 and 0mq during our R&D phase. 0mq's push/pull sockets provide the same "take" behavior as the Redis RPUSH/BLPOP, so we definitely could have used m2 as the HTTP end of a similar architecture to what we use now.

One of the considerations that led to the choice of Redis was the transparency of the queueing and dequeueing. The messages in the queue are easily inspected, and the Redis MONITOR command helps greatly in debugging.

More important from a design perspective was our desire to hide the HTTP specifics from the workers. m2 pushes a JSON or tnetstring representation of the HTTP request to its workers, but we want the task we send to the workers to be generalized, stripped of information that is only meaningful for HTTP. We also want to classify the task by resource type and requested action, which allows us to use multiple queues. Multiple queues allows us to implement workers on an ad hoc basis.

M2 could work here if our request classification only depended on the URL. But that is a limitation we are not willing to accept. Request headers can be very useful in dispatching, especially those related to content negotiation (Accept, Content-Type, etc.)

There is an interesting hybrid approach using mongrel2: write one or more m2 handlers that perform the same function as our node.js dispatchers. I.e. m2 sends the JSON-formatted request to an m2 handler that deserializes it, removes the HTTP dressing, classifies the request according to type and action, then queues a task in the appropriate queue. A worker takes the task, does its own little thing, and sends the result to an m2 handler that knows how to re-clothe the result as an HTTP response and deliver it to the m2 cluster.

Regarding the question about queue behavior across replicated Redises:

I do not know for certain, but I do certainly hope it is not possible for an item in a Redis list to be popped by more than one client, no matter how the replication is configured.

With our architecture, we could relieve at least some of the strain on the task/result messaging system by using a cluster of Redis servers for the task queues. Each queue server might have its own cadre of workers listening for tasks. The return trip (getting a result from a worker back to the HTTP front end) is a little trickier, because it matters which HTTP server is holding open the HTTP connection. You could use PUB/SUB (which I believe is how m2 currently does it), or each HTTP server could be popping results from its own result queue.

When using a single Redis server, the only hard limitation we have seen with using the BLPOP operation is the number of client connections Redis can keep open. In case it's not clear, the BLPOP is blocking for the client, not the server.