Linux – Why does a default Linux installation run more processes than a default OpenBSD installation

bsdlinuxopenbsdprocess

If I ps -aux on Ubuntu (or any GNU/Linux distribution) without GUI I see ~100 processes running. If I ps -aux on OpenBSD without GUI, then I get ~10 processes.

What is the explanation/reason for this? Are the *BSD systems much "clearer" (code) or do they just put everything in the kernel?

Best Answer

There is no correlation between the number of processes and the “clarity” of an operating system. You are comparing apples and gooseberries.

On a Linux system, ps ax will show a lot of processes that consume no memory and have a name in square brackets, like this:

root         2  0.0  0.0      0     0 ?        S    Nov02   0:01 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    Nov02   4:39 [ksoftirqd/0]
root         6  0.0  0.0      0     0 ?        S    Nov02   0:00 [migration/0]
root         7  0.0  0.0      0     0 ?        S    Nov02   0:01 [watchdog/0]
root         8  0.0  0.0      0     0 ?        S    Nov02   0:00 [migration/1]

These processes are part of the kernel. They run with kernel privileges, but they are managed like user processes by the scheduler (many of them with high priority because they handle hardware requests). The machine I'm writing this on has over 100 such processes — how many you have will depend on many things, including your kernel version, your hardware and what kernel services you run (e.g. some filesystems have kernel daemons).

These processes probably account for a large part of the different numbers. As far as I know, none of the BSD report such tasks separately, which makes your comparison meaningless.

In addition, a default OpenBSD installation includes very few services, whereas a default Ubuntu installation runs everything the average user expects to find. If you install the same software on both machines, you'll find similar numbers of non-kernel processes.

Related Question