HN user

jhgg

3,420 karma

currently: Member of Technical Staff of Supercomputing at xAI, building the biggest AI supercomputers in the world. https://grok.com, https://x.ai

formerly: Principal Engineer of "Core Technologies" at Discord. https://discord.com/

[ my public key: https://keybase.io/jhgg; my proof: https://keybase.io/jhgg/sigs/NfC1mAm4fGJgKsLzYcshaSlYAfvMnxgLUZgee3nWqzI ]

Posts17
Comments479
View on HN
github.com 3y ago

Structural Alignment of LLMs with ControLogits

jhgg
1pts0
blog.discordapp.com 6y ago

How Discord achieves native iOS performance with React Native

jhgg
5pts0
blog.discordapp.com 6y ago

Investigating Discord’s React Memory Leak

jhgg
5pts0
blog.discordapp.com 7y ago

How Discord Handles Two and Half Million Concurrent Voice Users Using WebRTC

jhgg
649pts244
blog.discordapp.com 7y ago

Why Discord Is Sticking with React Native

jhgg
278pts154
blog.discordapp.com 8y ago

Why Reactiflux, Vue Land, Yarn, and other open source communities use Discord

jhgg
64pts72
blog.discordapp.com 8y ago

Lessons from migrating a large codebase to React 16

jhgg
12pts0
blog.discordapp.com 9y ago

How Discord Indexes Billions of Messages Using Elasticsearch

jhgg
337pts58
blog.discordapp.com 9y ago

How Discord Stores Billions of Messages Using Cassandra

jhgg
438pts155
techcrunch.com 9y ago

Gamer chat app Discord hits 25m users, can now be used in developers’ own games

jhgg
5pts0
blog.discordapp.com 10y ago

Discord launches official Bot API

jhgg
4pts0
medium.com 10y ago

Discord Raises from Greylock for Gamer Voice Comms

jhgg
4pts0
www.eff.org 10y ago

Comcast Agrees to Pay $33m in Settlement for Leaking of Unlisted Numbers

jhgg
1pts0
blog.startifact.com 10y ago

The Emerging GraphQL Python Stack

jhgg
6pts0
super-gradient.ib.gs 11y ago

Show HN: SuperGradient – SASS Multicolor Gradient Mixin (Linear and Radial)

jhgg
2pts0
helloworldopen.com 12y ago

"Hello World Open" Code an AI for a race car – become World Champion

jhgg
1pts0
www.libjpeg-turbo.org 12y ago

Libjpeg-turbo's maintainer on why Mozilla forked libjpeg-turbo

jhgg
8pts0

Risk of deadlock is real if you have processes calling each-other in a cyclic way. e.g. process A sends GenServer call to process B, that then sends a GenServer call to process A to in order to handle the original call. However, process A is busy waiting on B to reply to it's initial call.

This is rarely a problem in practice however.

Eleven v3 1 year ago

This is not a model issue - you just have not properly implemented acoustic echo cancellation on your end.

Except this article is about how their efforts to prompt the LLM didn't end up working and how they used embeddings / vector search to filter out comments that the LLM generated based on user feedback.

ChatGPT Pro 2 years ago

Does that matter when you can just swap it for gpt-5-whatever at some point in the future?

ChatGPT Pro 2 years ago

Are you implying this technology will remain static in its capabilities going forward despite it having seen significant improvement over the last few years?

When I worked at Discord, we used BEAM hot code loading pretty extensively, built a bunch of tooling around it to apply and track hot-patches to nodes (which in turn could update the code on >100M processes in the system.) It allowed us to deploy hot-fixes in minutes (full tilt deploy could complete in a matter of seconds) to our stateful real-time system, rather than the usual ~hour long deploy cycle. We generally only used it for "emergency" updates though.

The tooling would let us patch multiple modules at a time, which basically wrapped `:rpc.call/4` and `Code.eval_string/1` to propagate the update across the cluster, which is to say, the hot-patch was entirely deployed over erlang's built-in distribution.

A content-defined chunking scheme allows for you to build a pretty efficient game patcher where you can update between any version of the game (forwards and backwards) and doesn't require a bunch of server-side shenanigans.

League of Legends blogged about their updater here: https://technology.riotgames.com/news/supercharging-data-del...

I built something strikingly similar at my last job around the same time as well. Our server-side code was remarkably simple, just holding manifests (list of files and their chunk hashes) + a GCS bucket where all the chunks were stored (filename was just the hash of the chunk, making it content addressable.) Patching just involved the client understanding which chunks it already had, and which chunks needed to be downloaded from the server, or moved between files. Uploading a "new version" of the game to the server was also simple, just figure out what chunks were not in seen in the prior N versions of the game by looking at their manifests, and uploading them to the server, along with a new manifest describing the final contents of the game.

Given updating to a new version was just a matter of downloading new chunks, or re-arranging chunks that already existed on disk, going from one manifest to another did not depend on the new version being the successor of the prior version.

The majority of a game patch isn't actually the executable (where content-defined chunking wouldn't work well) instead were game assets like textures, audio files, etc..., which is why this strategy worked really well.

No cache. Just read coalescing. There is a big difference. Coalescing just ensures that while a query is executing if an identical query arrives, rather than sending the same query as an already executing query to the database it will wait for the existing query to complete and duplicate the result. If after this the same query arrives again, it will be issued against the database.

This means we don't have to deal with cache invalidation/consistency issues while also being able to handle thundering herds, for example a large server pinging @everyone and having a bunch of people click into the channel or launch their apps in response.

Scylla just eats all the ram it can with cache. So it's hard to say really. On Cassandra we allocated half the ram to the JVM which it gladly used up and left the other half to the OS for disk cache. On Scylla, since it uses direct io, there is no need for OS disk cache.

Read traffic is much higher than write traffic due to mobile clients needing to sync chat history more often as their sessions are much shorter lived. Also search queries execute 1 query per result. And don't forget people doing GDPR data dump requests. It adds up.

Nope. Didn't change the schema, mainly added read coalescing and used ICS. I think the big thing is when Scylla is processing a bunch of tombstones it's able to do so in a way that doesn't choke the whole server. Latest Scylla version also can send back partial/empty pages to the client to limit the amount of work per query that is run.

There are ballpark of a few hundred million discord servers... do you really want to run that many Postgres instances? And even so what do you do about DM/GDMs? Easier to just run one big mega cluster for messages.

Fwiw the benchmarked numbers are for writing very small rows. When doing the messages migration, with no read traffic, and the cluster/compaction settings tuned for writes we only managed approx 3m inserts/sec while fully saturating the Scylla cluster.

Yes, we wanted to migrate all our data stores away from Cassandra due to stability and performance issues. Moving to something that didn't have those issues (or at least had a different set of less severe issues) while also not having to rewrite a bunch of code was a positive.