Score:0

Is it normal for beam.smp to have hundreds (1000+) threads running?

br flag

I recently installed RabbitMQ on a Debian 11 server and noticed that the vast majority of threads now belong to the same process - beam.smp. From what I found on the Internet, this process is Erlang's runtime or VM, a dependancy of RabbitMQ. The output of ps indicates that it is a single process with 1200 threads.

$ ps -e | grep beam.smp | wc -l
1
$ ps -eLF | grep beam.smp | wc -l
1200

CPU usage is very low, so all these threads must be sleeping. However, I find it very weird for a single process to have that many threads.

Is this normal or is it a sign of misconfiguration? Or could it be a bug? It doesn't seem to cause any immediate issues but could it lead to problems at a later time?

Normally I would provide the contents of a configuration file but in this case I can't find the configuration file that is responsible for beam.smp.

Score:0
cn flag

Thousands of threads is easy with Erlang. Likely you can use that tuning as is, especially if resource use is manageable.

BEAM is the reference Erlang VM which is what RabbitMQ is built on. Erlang has native concurrency, with lightweight processes doing message passing. So lightweight RabbitMQ docs discuss 2 million processes for very large numbers of concurrent connections. Other resource limits constrain how large the system can get in practice.

On Linux, threads happens to be the implementation to make the runtime go. Which means many tasks that share the same group ID, and they appear as the same process ID (different meaning from Erlang processes).

On POSIX systems very many threads is not common in applications. Appreciate that the PID is the only way to count tasks. For example, with SMP, one many-threaded PID can exceed 100% CPU.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.