Solved What is "find" process at bootup ?

Every time I bootup my freebsd desktop (KDE plasma on bare metal, not any VM), there's a background process started called "find" that keeps the CPU loaded for a while. Also plenty of HDD activity.
Sometimes this gets so annoying, I just kill the process.
Please, what does this process do ? Perhaps some kind of indexing ?
Is it necessary ?
Can this process be safely removed from the boot sequence ?
TIA's for any tips or clues.
 
Could be many things. One that comes to mind: You could have locate turned on (it's a good thing to have), but that should be running in the middle of the night, not after every boot.

Suggestion to find out which process it is: Use ps auxww to get the whole command line, and ps auxj to get the parent process id. Then follow the parent process to see who started the find (was it cron, was it periodic, ...). Once you have that info, we can maybe help identify it.
 
quick look in /etc/rc.d, I think the only "find" that would truly run at start comes from ldconfig, but that should only be running on limited number of directories. In the periodic scripts there are some find but as pointed out they shouldn't be running at startup, they run in the middle of the night/3am timeframe.

Are you booting to KDE from a display manager or are you running startx? If you boot up to a display manager, what happens if you disable that and reboot? Do you get the same thing? If not, then it's likely something in KDE autostarts that is doing an index type of thing.
 
Every time I bootup my freebsd desktop (KDE plasma on bare metal, not any VM), there's a background process started called "find" that keeps the CPU loaded for a while. Also plenty of HDD activity.
Sometimes this gets so annoying, I just kill the process.
Please, what does this process do ? Perhaps some kind of indexing ?
Is it necessary ?
Can this process be safely removed from the boot sequence ?
TIA's for any tips or clues.

It isn't clear whether this is started from /etc/rc.d or from your desktop. As mentioned you can probably find that out with `pstree`.

To find out what that sucker is doing in the first place use `ps ax` or `ps aex`.
 
The automated pkg audit comes to my mind.
Yes, it is super-annoying.
One has to kill this crap again and again when it comes up as you need the computer.

So my question:
How to bog down the priority of this and similar minor-importance tasks to acceptable priority, so it no longer factually takes the computer offline until its run got finished?
 
the pkg audit should be happening from periodic, so once a day if daily security is enabled not every bootup.
 
How to bog down the priority of this and similar minor-importance tasks to acceptable priority, so it no longer factually takes the computer offline until its run got finished?

find(1) is I/O bound, so niceing has little effect.
 
Good, maybe another mitigation for the pkg audit annoyance could be to modify it so it does not spawn dozens of find processes in parallel, that bring the computer to a unresponsive standstill, and make your clients ask why the website no longer responds.

In regard to KDE and find, maybe deleting baloo could be the correct fix?
 
How to bog down the priority of this and similar minor-importance tasks to acceptable priority, so it no longer factually takes the computer offline until its run got finished?

I'm finding it difficult to see any number of parallel find() jobs effectively "taking the computer offline", unless they've had priority specifically boosted. What does 'nice top' have to say about CPU and disk utilisation and load average while this is going on?

find(1) is I/O bound, so niceing has little effect.

Indeed, but is I/O bandwidth so seriously impacted as to impede network services?

Waiting to hear OP's report from 'ps auxww' etc, allied with top or maybe 'systat -vm' data indicating CPU or I/O bound?
 
As this crontab pkg audits runs deep in the night (I think 3, 4 am once a month) mainly night owls and skunks are affected.
Imagine you are working on some code, and suddenly the HDD light lights up permanently, the computer becomes practically unresponsive, the input you write appears a minute later on the screen, and it takes a subjective eternity to switch to another terminal, and you find the top screen full of find threads bogging down the computer.
If you aren't in the mood to take a break, waiting for this to finish, you have to do some killall find killall pkg to stop this annoying spectacle... In the case of baloo this is some process like "baloo_runner" or the like.

Maybe with SSD this is less annoying than with spinning rust...
 
As this crontab pkg audits runs deep in the night (I think 3, 4 am once a month) mainly night owls and skunks are affected.

Refer to what yuripv79 said, but the OP only mentioned boot time, so is probably a different issue?

Imagine you are working on some code, and suddenly the HDD light lights up permanently, the computer becomes practically unresponsive, the input you write appears a minute later on the screen, and it takes a subjective eternity to switch to another terminal, and you find the top screen full of find threads bogging down the computer.

Sounds like seriously underpowered hardware, but maybe you could show some results rather than telling?

The systat -vm screen is pretty useful to convey overall coverage of CPU, interrupts, memory, I/O, load etc ...

Maybe with SSD this is less annoying than with spinning rust...

Certainly, but you could check those daily & weekly periodic scripts to limit any excessive parallel tasks, priorities etc, rather than just killing them?
 
Refer to what yuripv79 said, but the OP only mentioned boot time, so is probably a different issue?
I guess either something baloo or some deferred checks that start when OP starts his machine.

Sounds like seriously underpowered hardware,..., rather than just killing them?
Ivy Bridge Xeon with 256GB RAM and 64GB swap partition on SSD. On my former computer without SSD it was even worse. I sometimes just turned it off and on again to stop that nuisance.
The actual reason for the problem is Firefox. I use more than a dozen windows with many tabs, and on FreeBSD Firefox has difficulties to release memory (something with mozmalloc not implemented on FreeBSD). So one needs to restart it periodically when it has consumed a too big part of memory over months of use. However I hate to do so, as this means ordering the windows anew. And if one is low on RAM and these periodics suddenly kick in, this can lead to permanent swapping, rendering the computer unresponsive even with SSD swap partition.
Thus your suggestion is good, checking memory usage more frequently and do a firefox restart in time.
 
I believe the mystery solved. Thanks for suggestions above.
Baloo already disabled a while ago. Not KDE either.
Seems it is indeed /usr/libexec/locate.updatedb
This is caused by computer being switch off when not being used for a coupla days (to save electrons), and then the missed periodoc process/es being caught up on bootup.
I didn't realise the periodic task was this clever.
Happy to let this continue, since i do use locate reasonably often.
 
... and on FreeBSD Firefox has difficulties to release memory (something with mozmalloc not implemented on FreeBSD).
... So one needs to restart it periodically when it has consumed a too big part of memory over months of use. However I hate to do so, as this means ordering the windows anew.
You could try a different browser which is more memory-efficient, or at least knows how to return memory. I also think there are some browsers that remember the order of tabs and windows, and restore that on a restart. Worth experimenting.

Happy to let this continue, since i do use locate reasonably often.
If the locate process doing a lot of IO really annoys you, but you don't want to keep your computer on over night, maybe you can change the schedule for periodic. For example, if every day you go to lunch from noon to 1, then schedule it for 12:05 and leave the computer on.
 
Sounds like seriously underpowered hardware
Ivy Bridge Xeon with 256GB RAM and 64GB swap partition on SSD.

[cough] I take that back ...

And if one is low on RAM and these periodics suddenly kick in, this can lead to permanent swapping, rendering the computer unresponsive even with SSD swap partition.

Fair enough. I still wonder if it wouldn't be relatively easy to tune such periodic scripts to play nicer, or fewer in parallel, even if taking longer elapsed? But I'm out of time to test ...
 
I still wonder if it wouldn't be relatively easy to tune such periodic scripts to play nicer, or fewer in parallel, even if taking longer elapsed? But I'm out of time to test ...
A typical find process (such as locate, or backup software, or virus scanning or intrusion detection) is very IO intensive. It traverses the directory tree, reading each directory, then reading the metadata for each file (size, mtime, ownership), and then often reading each file. It uses very little CPU time, but keeps the disk very busy. The usual implementation is single-threaded, and they issue one IO at a time to the disk. Most of these IOs will be small reads (a few kB at a time), so the disk will be very inefficient, mostly seeking. But because most of these IOs are random reads (with long seeks), each of them will take typically 10ms on a spinning disk.

When a foreground task (like a human trying to get some work done) now competes with this workload, it will typically get about 50% of the disk's throughput. If the foreground's workload is small sequential IOs (which typically get served in ~ms), having that reduced tenfold may feel very slow.

Note that none of this has to do with swapping: there is no excessive memory usage, and no memory has to be sent to/from disk. But the symptoms feel the same: Operations that used to be really fast are suddenly slow, and the disk is 100% busy. There are lots of things in the OS to help in this case, for example prefetching in the file system, and IO scheduling. But ultimately, the system has to find a compromise between two conflicting goals: Making background batch workload (such as the locate/find/backup/... software) run efficiently with high throughput, while making foreground workload (user tasks) have low latency. That compromise is particularly hard when both batch and foreground are low intensity (only one IO at a time).
 
Back
Top