News for hackers. Stuff that matters.
Re:I wrote the BEAM book (2025) by thibaut_barrere on Wednesday November 11, 2026 @03:54AM (#50451114)
Fair enough! That’s how we track growth, it’s easier to communicate to state sponsors.

Roughly 14M per day, but growing 2.5 to 3 on a YoY basis.

My point stands though: much more serenity in ops with that growth, and LLMs do work nicely, especially when most of the code is stateless by language design.

Re:I wrote the BEAM book (2025) by shakna on Wednesday November 11, 2026 @04:30AM (#50451332)
Being generous... That's about 10k/s? So you're just in range of the C10k problem that OTP was built to overcome?
Re:I wrote the BEAM book (2025) by thibaut_barrere on Wednesday November 11, 2026 @04:50AM (#50451513)
~160 req/s on average, higher peaks. Not trying to impress anyone though, my point was that LLMs work perfectly fine on an Elixir codebase, and that we get future-proof ops on a single node with zero issues. In my experience, it has been easier than with any other stack I've tried.
Re:I wrote the BEAM book (2025) by whizzter on Wednesday November 11, 2026 @07:28AM (#50452638)
To be fair, Erlang runtime semantics (cooperative "async threads") never needed changing to tackle C10k problem, they got that right as part of the early designs before C10k was even on the tasble.

Everyone else just moved towards the same kind of cooperative thread runtime semantics (even if the lingo differs, async in C#, callbacks first, then async in NodeJS, virtual threads in Java, async in C++ and so on).

I think an interesting historical tidbit is that Java actually had M:N threading in early versions (1.1, 1.2, 1.3?) that got ripped out because it was deemed complex and error-prone since people back then often did native bindings naively (And perhaps file/socket API's were less complete?) only for them to reintroduce it again in Java 20 I think it was under the virtual threads name?

Re:I wrote the BEAM book (2025) by spider-mario on Wednesday November 11, 2026 @10:50AM (#50454828)
> I think an interesting historical tidbit is that Java actually had M:N threading in early versions (1.1, 1.2, 1.3?)

Yeah, they called that “green threads”. https://en.wikipedia.org/wiki/Green_thread

Re:I wrote the BEAM book (2025) by Jtsummers on Wednesday November 11, 2026 @11:23AM (#50455200)
[delayed]
Re:I wrote the BEAM book (2025) by toast0 on Wednesday November 11, 2026 @11:40AM (#50455410)
> Cooperative scheduling is based on the programmer releasing control manually (much like manual memory management) or having yield points baked into the language, often at function calls or IO events. Processes on BEAM can be preempted, they're allotted a number of "reductions" and when those are exhausted, the process is preempted (the process may also yield earlier).

BEAM is actually cooperative. In userspace, function calls and IO (receive and !) are yield points, and reduction count is simply the number of function calls you're allowed. Something something Computer Sciencey reduction basically means function call.

It just feels preemptive because as a functional language, you have to call functions all the time. Your loop becomes

   loop(I) -> loop(I + 1).
And that will yield once it calls itself enough times.

Native code (NIFs, BIFs, and drivers) has to count reductions and/or yield explicitly.

You can easily hog scheduler threads in native code that does significant computation or does i/o without using the runtime facilities; most people who write NIFs will mess it up at least once, I certainly have. It's much harder to do in userspace code, but if you fully unroll a very large loop that does not call functions or anything else that can yield, you can do it; I don't see how this would happen without specific intent, I've never run into it, but it's possible.

A blocked scheduler can be vaguely fine or terrible depending on how long it stays blocked and what the system is up to. Often it won't be terrible until you do something that needs all schedulers to synchronize, such as operations around code loading, but you can probably wedge the whole BEAM if you try.

Re:I wrote the BEAM book (2025) by twoodfin on Wednesday November 11, 2026 @11:57AM (#50455628)
My recollection is that M:N ("green") threads were pulled out because in the absence of a runtime that can guarantee a thread is never blocked, you essentially have to reintroduce all the complexity of an OS scheduler without the benefits of OS-wide context.

"Project Loom" spent much of its time (AFAICT) figuring out how to make every Java system-level API non-blocking without breaking backward compatibility. The only one they didn't get to for the initial release was Java's "interesting" built-in `synchronized` object monitor construct.

Re:I wrote the BEAM book (2025) by toast0 on Wednesday November 11, 2026 @11:25AM (#50455226)
10k requests/sec is not really the same thing as the C10k problem which is 10k concurrent connections. You might serve much more or less than one request per second per connection, so req/s and conncurrent connections are not really related.

I also wouldn't say OTP was built to overcome the C10k problem. It is a very good solution for lots of concurrent connections (with a suitable OS), but OTP was built to manage concurrency needs in the context of telephone switches. The constraints chosen to meet those needs does work (very) well to meet the challenges of large numbers of concurrent IP connections, but I wouldn't say it was built to overcome those challenges.

Re:I wrote the BEAM book (2025) by Zanfa on Wednesday November 11, 2026 @04:43AM (#50451448)
The important metrics is peak requests per second. 14M / day sounds impressive, but it’s only a sustained 160 per second which literally any language and framework can handle on the lowest end hardware.
Re:I wrote the BEAM book (2025) by thibaut_barrere on Wednesday November 11, 2026 @04:53AM (#50451535)
Sure, peaks are much higher. But a good part of it is reverse proxying with in-memory caching and locking, which I've implemented in several stacks over the years, and many struggle with it (I have been paid to do comprehensive benchmarks on the topic). On the BEAM it's a non-event.
Re:I wrote the BEAM book (2025) by kryptiskt on Wednesday November 11, 2026 @07:51AM (#50452806)
Only if users are nice and spread the load evenly over the day, but they are never so considerate.
Re:I wrote the BEAM book (2025) by Zanfa on Wednesday November 11, 2026 @08:40AM (#50453297)
Sure, that's why I highlighted peaks as a more important metric than average. Even an order of magnitude higher peaks over the average is still fairly trivial, compared to where BEAM shines. Maintaining hundreds of thousands of concurrent long-lived connections per server is what it excels at, but also not something that's relevant to 99% of web apps out there.