Since a few months, on one of the desktop Ubuntu 14.04 systems I use, CPU has regularly been going up to 80-100% for no apparent reason. htop
would usually attribute responsability to file system processes, such as nemo
or ntfs
. To get CPU back down I would kill these process, which in some cases would lead to loss of access to the file system and a consequent restart.
Days ago I noticed that whenever this situation happened another process was always present also using high CPU: mediascanner-service-2.0
. Some research lead me to this thread at the Forum that simply advised its removal. So I did.
The end result has been unexpectedly positive: not only are the high CPU load episodes gone, the system is altogether much faster. The speed up of the Lens is dramatic: finding an application like Calc now takes 2 seconds at most when previously it took some 20 seconds. Finding a file takes now some 5 seconds, whereas before it took in the order of 30 seconds. Heavy programmes like Eclipse are starting up faster and workspaces are more fluid. There seems to be also an overall reduction in the frequency of disk access.
What is exactly this mediascanner2.0
package? Is it part of Unity 7 or a dependency that gets installed a posteriori? Is it possible to prevent its installation?
Update: following Seth's suggestion it is possible to track this package down to indicator-session
:
$ sudo aptitude why mediascanner2.0
i indicator-session Recommends indicator-applet (>= 0.2) | indicator-renderer
i A unity8 Provides indicator-renderer
i A unity8 Recommends unity-scope-mediascanner2
pi unity-scope-mediascanner2 Depends mediascanner2.0
Apparently, mediascanner2.0
(and the Unity 8 shell) are part of the base 14.04 system. Left to answer is the exact function of this rogue package.
mediascanner2.0
is a package used in Unity 8 to discover media and then play it. For example, the Core Music App on Unity 8 usesmediascanner
to scan the music directory(or any directory for that matter) and then play back music. Since Ubuntu is moving towards Unity 8, it is included by default in the Ubuntu iso.mediascanner
is scanning your whole hard drive to discover media, so the first time around, it will slow your computer. Eventually, it should cache its results, and then it will stop being so resource intensive.You have two options to help fix your issues:
mediascanner
to not attempt to scan a directory by creating a new fie and titling it.nomedia
. Then, whenmediascanner
reaches this directory, it will not even bother to index it. In theory, you can do this for as many directories on you computer, andmediascanner
should stop indexing them.mediascanner
is a dependency.Hope this helped :)
Source