Jump to content

Baloo/Debugging

From KDE Community Wiki

Baloo is responsible for searching through files. Given that every system is quite different, and many different files can have different results, there can be some issues with Baloo. This page aims at helping you debug what exactly is going on and how to report the issue appropriately.

If you're in doubt, and not sure what is going on, please just file a bug and provide whatever information you feel may be appropriate. The developers will ask for more information and provide steps for you to follow.

Baloo is consuming too much CPU / RAM / Disk IO ?

The Baloo Project is responsible for many different parts of KDE. The developers need to know exactly which component is problematic. It would be best if you checked what the offending process is called.

baloo_file

This process is responsible for scheduling the indexing of files and save the name of the file. If this process is consuming too much CPU or Disk IO, it's probably cause of the initial indexing. Based on your hard drive speed, baloo_file is able to do somewhere between 100 to 1000 files per second. Depending on how many files you have, it could take a couple of minutes. It would be best to just wait for a couple of minutes.

If you feel that you have been waiting for quite some time, and the baloo_file process is still consuming too much CPU or disk IO, please file a bug.

baloo_file_extractor

This process is responsible for looking into the contents of the file, and indexing it. It can cause a reasonable amount of disk and cpu io depending on the type of files you have. This extractor process is generally commanded to index files in batches of 40.

You will commonly see it running as follows - baloo_file_extractor 2343 2344 2345. These numbers indicate the files that it is currently processing. If you feel that the extractor is consuming too much cpu / ram / disk usage, it is probably because one of these files.

Each file is represented by a unique number. This number can be resolved into the corresponding URL by running the balooshow command on them. Eg - balooshow 2243.

When reporting a bug regarding the extractor, it is important that offending file be tracked down. This can be done as follows.

  1. Run ps aux | grep baloo_file_extractor and note down the numbers at the end of the process.
  2. Kill Baloo via killall baloo_file && killall baloo_file_extractor
  3. Launch baloo_file_extractor on any one of those numbers.
  4. Check if baloo_file_extractor is still causing problems
    1. If it is not, goto (3), and try again with another file number
    2. If it is causing problems, then file a NEW bug on bugzilla and upload the offending file.

baloo_file_cleaner

The cleaner process is responsible for cleaning out invalid files from the index. This process is only called when the system configuration for Baloo is modified. If you feel that this process is consuming too much CPU or disk IO, please report a bug immediately.

On disabling Baloo, the baloo_file_cleaner would take some time in cleaning the database in 4.13.0. This has been fixed with 4.13.1, it now just directly deletes the database files.

akonadi_baloo_indexer

The Akonadi part of Baloo is completely separate from the file parts. If you feel that this process is consuming too much CPU usage, it may just be the initial indexing. Based on our tests, it can easily index 100000 emails in under 10 minutes. If after 10 minutes, the system is still choking up, please report a bug.

My Files were not found in the search results

Baloo provides simple command line tools to directly search in its index. It is best to cross check with one of these tools. That way the developers know if the problem is with baloo or with the search interface.

balooshow

The BalooShow tool is used to print debug information about a file.

   $ balooshow /home/vishesh/file.jpg
   4 /home/vishesh/file.jpg
           Width: 713
           Height: 955
           Photo X Dimension: 713
           Photo X Dimension: 955 

Please run this tool on the file which is not being found. It should print information similar to what is being printed above. If no information is printed, then please check the following

  1. The file is not in the list of exclude folders
  2. The baloo_file process is running.

baloosearch

The Baloosearch tool can be used to perform simple searches.

 $ baloosearch fire
   77040 /home/vishesh/kde5/src/qt5/qtimageformats/tests/shared/images/mng/fire.mng
   237751 /home/vishesh/Videos/Catching Fire Epic Review Special Edition.mp4
   237788 /home/vishesh/Videos/The Hunger Games Catching Fire (2013) [1080p]
   237790 /home/vishesh/Videos/fire.mp4
   53907 /home/vishesh/kde5/src/qt5/qtwebkit/Source/WebCore/html/MediaController.cpp
   54051 /home/vishesh/kde5/src/qt5/qtwebkit/Source/WebCore/html/HTMLMediaElement.cpp
   52257 /home/vishesh/kde5/src/qt5/qtwebkit/Source/WebCore/platform/ThreadTimers.cpp
   52867 /home/vishesh/kde5/src/qt5/qtwebkit/Source/WebCore/loader/NavigationScheduler.cpp
   53568 /home/vishesh/kde5/src/qt5/qtwebkit/Source/WebCore/html/track/TrackListBase.cpp
   52255 /home/vishesh/kde5/src/qt5/qtwebkit/Source/WebCore/platform/Timer.cpp

You should try searching for the file with this command. By default it only lists the first 10 results.

If the file is not found even though it is indexed, then please file a bug with the exact search term, and the relevant words in the file.