With KDE 4.10 the file indexer has undergone some major changes which made it pretty usable so I decided to switch it on again. It turned out that the first stage indexing works exceptionally well. It indexed about 60,000 files in my home directory in the blink of an eye.
Unfortunately, I had to realize that the second level indexing does not work so well. I remember Virtuoso often eating up all my CPU in the past. Now Virtuoso keeps quiet, but nepomukindexer let's my workstation fly. It only starts indexing when my PC is idle, but for bigger files it keeps the CPU busy at a level of 100%, which is a pretty bad thing. There is already a Bug report about nepomukindexer consuming too much CPU time on larger files, but I didn't want to wait for a fix.
Long story short: I thought of ways to automatically limit the CPU usage of certain processes (not necessarily only Nepomuk).
Processes in Linux may run with different priorities so that important processes get more CPU time than less important ones. This priority is called the “nice value” or ”niceness” (NI). The nice value is a number between -20 and +19 with the default value right in the center at 0. The higher this nice value, the “nicer” a process is to others, i.e., the lower its priority.
You probably know command substitution. Command substitution executes a command and uses its output as a variable on the shell. The operator for this is either the backtick operator. But did you also know that there is a counterpart of command substitution? This counterpart is called process substitution.
You've probably heard of lsof and fuser. Since on UNIX systems everything is a file, these tools are absolutely important to know for each system administrator. They can make your work easier and they can also help identifying attacks on your system.
Processes are a very complex but important topic for understanding how Linux works. Covering all details about process management in Linux wouldn't be possible for one blog post, but let's have a bit of informative fun with process creation and especially with their deletion. It's Halloween and which topic could be more appropriate than birth, death and undeads?