Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
1  
A ps aux on a vanilla Debian shows 53 processes on a FreeBSD it shows 39 processes. Where did you get your the numbers 10 and 100 from? –  Marco Nov 8 '12 at 11:34
    
from openbsd vs. ubuntu :) –  gasko peter Nov 8 '12 at 12:48
1  
First: You are comparing one of the biggest bloated Linux distributions with one of the most minimal BSD distributions. What do you expect? Second: Since regular Ubuntu comes with a GUI I assume you mean Ubuntu Server. A ps aux on a current vanilla Ubuntu Server yields 59 processes. Where did you get the number 100 from?? –  Marco Nov 8 '12 at 13:22
1  
@Marco: Let's say he exaggerated the 10/100 digits to make his point. Still, isn't it your impression as well, that BSD systems have much fewer processes? –  Emanuel Berg Nov 8 '12 at 19:34

3 Answers 3

up vote 7 down vote accepted

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.

share|improve this answer
    
On a CentOS 6.3 machine (minimal w/ redhat-lsb), ps aux|grep -v "\[.*\]"|wc -l returns 26 processes. –  JodieC Nov 11 '12 at 3:55
    
we have a winner :) –  gasko peter Nov 12 '12 at 19:39

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.

share|improve this answer
    
This "clean or not" is not really the point. We are trying to understand, why systems in general would differ in this respect, and in particular those systems mentioned? –  Emanuel Berg Nov 8 '12 at 19:37
    
udev uses dbus? On what system? –  Stéphane Chazelas Nov 13 '12 at 23:13
    
@StephaneChazelas: It doesn't? I stand corrected. However, with udev integrated into systemd I'd say it does use DBus (but my example case is still a little tattered). –  sr_ Nov 14 '12 at 7:47

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.