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

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?

Asked By: gasko peter

||

The number of running processes is not necessarily a good indicator for “clarity”.

Take, for example, FreeBSD’s devd which uses a socket to communicate where udev uses D-Bus (and hence needs another dbus-daemon process). Process count: 1:2. But D-Bus brings in a lot more features and possibilities, many other system daemons use it (handled by the same dbus-daemon process), too. Now which one is clearer?

Plus, I guess you can get any non-GUI GNU/Linux system to “use less processes”, by sacrificing features (i.e. don’t use any *Kits) — and a fair comparison between a BSD and this system (for what it’s worth) can only be done when the feature set matches.

Answered By: sr_

Maybe this means you’re a heavier linux user? When you’ve loaded up some more services on your BSD machine, it’ll happily fill over time up with crufty daemons like the linux one.

It’s also a reflection perhaps on the amount of junk in a modern linux distribution. The FreeBSD base system is really very light indeed. Comparing it to something like a clean Slackware install might be a better comparison. I doubt that comes with fifty processes out-of-the-box.

Answered By: Nicholas Wilson

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.

Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.