mediascanner consumes a lot of cpu for a long time

Bug #1237065 reported by Alan Pope 🍺🐧🐱 🦄
126
This bug affects 29 people
Affects Status Importance Assigned to Milestone
mediascanner2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Image #83 on mako.
I have the following content on my device:-

phablet@ubuntu-phablet:~$ find Music/ | wc -l
114
phablet@ubuntu-phablet:~$ find Videos/ | wc -l
9

mediascanner is eating cpu:-

top - 20:47:14 up 10 min, 1 user, load average: 2.05, 1.95, 1.18
Tasks: 218 total, 1 running, 216 sleeping, 1 stopped, 0 zombie
%Cpu(s): 25.1 us, 0.3 sy, 0.0 ni, 74.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 1916236 total, 1021212 used, 895024 free, 13320 buffers
KiB Swap: 524284 total, 0 used, 524284 free, 650988 cached

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 2274 phablet 20 0 210m 22m 15m S 98.3 1.2 9:58.54 mediascanner-se
 3066 phablet 20 0 4396 1124 740 R 1.3 0.1 0:00.16 top
  710 root 0 -20 6576 564 416 S 1.0 0.0 0:06.64 mpdecision
    4 root 20 0 0 0 0 S 0.3 0.0 0:00.96 kworker/0:0
  793 root 20 0 0 0 0 S 0.3 0.0 0:00.44 kworker/1:1

Tags: avengers
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Revision history for this message
Michal Hruby (mhr3) wrote :

This should be fixed with latest media stack, can you still reproduce?

Changed in mediascanner:
status: New → Incomplete
Revision history for this message
Vanishing (vanishing) wrote :

I am on trust at this moment, and mediascanner-service is take up a lot of cpu, somewhere around 90-100% on 1 core.

Revision history for this message
Daniel Holbach (dholbach) wrote :

What I noticed was that mediascanner-service ran over all the directories in ~, then a new process came up and did the same. This is on trusty (2013-11-14) on a laptop. Easy to see if you tail -f .cache/upstart/mediascanner.log

Revision history for this message
Michael Murphy (mmstick) wrote :

Same problem here in Trusty.

Revision history for this message
Thilo Cestonaro (tephraim) wrote :

Can I somehow give mediascanner hints where it should NOT search for music? I have folders in my home folder which contain a whole linux dist in source code and stuff ... and it takes ages for mediascanner-service to scan that stuff. And while it scans, min. one CPU is 100% used but with a second mediascanner process it will eat my cpu :( ....

Please either let me configure which folder it should scan or not scan, or set the nice value of the process to something that it is irrelevant for the normal work.

Cheers
Ephraim

Revision history for this message
tomdryer (tomdryer-com) wrote :

I have the same issue as Ephraim. I have a drive attached with 100s of GBs of backups, and as soon as I log in mediascanner starts trying to scan it all. I had to remove the executable bit from the process so I could kill it without it resuming.

Revision history for this message
Tim Peeters (tpeeters) wrote :

I seem to have the same problem on trusty. mediascanner-service is always using around 100% CPU (4 cores), and my laptop battery only lasts 1.5 hours instead of the normal 6. When I kill the process a new one is created immediately, and I cannot find the package to which the mediascanner-service belongs.

Revision history for this message
Tim Peeters (tpeeters) wrote :

In the logs I see it is scanning all the sources (qt5!) in my ~/Download. There should be a way to restrict the directories where it searches and to disable mediascanner completely.

Revision history for this message
Tim Peeters (tpeeters) wrote :

mhr3, I am on trusty and dist-upgrade every week. The problem is still there.

Changed in mediascanner:
status: Incomplete → Confirmed
Revision history for this message
epe (eric-poscher) wrote :

It seems to scan all the external backup harddisc - when it's connected it keeps running.
Please implement/document how to configure it to exclude certain areas of the system.

otherwise I will have to remove it from my installations.

Revision history for this message
Ignacio Tartavull (tartavull) wrote :

+1

Revision history for this message
Andreas E. (andreas-e) wrote :

The same situation (on 14.10): It runs with 100% CPU as soon as I connect a backup drive (déjàdup) or a phone (to sync music to the phone, not to index the phone!). Scanning local files may have a benefit, but I don't think scanning any external device without user's intention is acceptable at that cost. Until this issue is fixed, it would better not be part of a stable Ubuntu release.

Revision history for this message
Peng (pengwg) wrote :

In 14.10 it appears my whole file system becomes very slow when it is running. Quit obvious impact on my apt-get speed.

affects: mediascanner → mediascanner2
affects: mediascanner2 → mediascanner2 (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.