apt-index-watcher uses way too much system ressources

Bug #64531 reported by Marc Schiffbauer
110
Affects Status Importance Assigned to Milestone
libapt-front (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: apt-index-watcher

Hi,

I upgraded my dapper do edgy. And now I was wondering what was making so much "trouble" on the system now: On my ksysguard Graphs I can see lots of nice/user cpu power used every few seconds and memory usage going up and down every few seconds. Then I stoppen apt-index-watcher and everything was OK again...

Perhaps it would be OK to just stop it doing its job that often? I guess once an hour or twice a day would be enough... not?

-Marc

Revision history for this message
Andreas Simon (andreas-w-simon) wrote :

I can confirm this with apt-index-watcher 0.3.9ubuntu4. Every couple of seconds two processes like

 6927 ? S 0:00 sh -c /usr/sbin/apt-index-watcher run --syslog
 6928 ? R 0:02 /usr/sbin/apt-index-watcher run --syslog

use all available cpu power.

Changed in libapt-front:
status: Unconfirmed → Confirmed
Revision history for this message
depp (li-sun) wrote :

i noticed if i run apt-get update once, apt-index-watcher begins to be in service and uses cpu, as soon as i run once adept, it'll stop updating

Revision history for this message
Jason Straight (jason-jeetkunedomaster) wrote :

I've got a local mirror of edgy-i386 on an external HD on my laptop. apt-index-watcher runs my CPU up to 100% every 5-7 seconds for a couple seconds, even though my local mirror has not been updated.

Not very good for laptops at all, the battery use and fans, and cpu running at full throttle, etc...

Revision history for this message
Erik Meitner (e.meitner) wrote :

This just started for me today. I noticed that the fan on my laptop was running continuously. Watching a CPU graphed showed a spike every 4 seconds or so. Obviously, it is very bad for battery life on a laptop. I just noticed this today.

Currently using apt-index-watcher_0.3.9ubuntu4.

emeitner@cheren:~$ sudo time apt-index-watcher watch --syslog
Command terminated by signal 2
34.40user 1.26system 2:07.52elapsed 27%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+105823minor)pagefaults 0swaps

I downgraded to apt-index-watcher_0.3.9ubuntu3 and the CPU usage spikes ceaced to occur.

I wonder if the recent change has anything to do with it: " make sure apt-index-watcher uses a different mmapable() cache file so that it does not corrupt the main apt mmap cache (lp: #61708)"

Revision history for this message
Petri Järvisalo (reaby) wrote : issues with 3d acceleration also

i was wondering why wolf et runs smoothly, but constantly after about 5-8 secs DPS drops from 90 to under 5 for short period of time. then i managed, with help of top, to find that problem is apt-index-watcher.
so only solution for smooth gameplay is manually killing watcher by

ps -A | grep apt-index

and then

kill [number]

Revision history for this message
finalbeta (j-greenhouse) wrote :

Confirmed here.

Revision history for this message
Guillaume Martres (smarter) wrote :

I can confirm this (and nice -n 19 doesn't change a lot)

Revision history for this message
Jools Wills (jools) wrote :

I also have this problem. Only noticed it the last few days or so. Makes playback of videos stutter and other problems.

Revision history for this message
blackrim (blackrim) wrote :

just confirming this. really annoying. adept updating, as suggested above, doesn't seem to fix mine. i have to do the killall apt-index.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

This problem should be fixed with the upload of 0.3.9ubuntu5. Please reopen if it is still a problem for you after the update.

Cheers,
 Michael

Changed in libapt-front:
importance: Undecided → Medium
status: Confirmed → Fix Released
Revision history for this message
Jools Wills (jools) wrote :

Noticed it again today

5557 root 19 0 17216 13m 10m R 95.8 1.3 0:00.79 apt-index-watch
3989 root 15 0 157m 20m 6076 S 4.0 2.0 0:37.68 Xorg
1 root 15 0 1632 540 448 S 0.0 0.1 0:01.03 init

Running latest version 0.3.9ubuntu5

Changed in libapt-front:
status: Fix Released → Confirmed
Revision history for this message
Leonidas Arvanitis (larvan) wrote :

It is still bugged for me too.
version 0.3.9ubuntu5

Actually a better command to close it, is:

sudo /etc/init.d/apt-index-watcher stop

Revision history for this message
Mika Wahlroos (mpw) wrote :

I've experienced this with 0.3.9ubuntu5 on stable Edgy.

I'm not sure if it uses overly much resources in total, it's just that it decides to pop in every few seconds to do something at full steam for a while that's causing problems for me. Since it isn't niced, it causes frame rates in games to drop significantly, and might actually make some high resolution videos stutter because decompressing them can take nearly all the CPU power my system can provide.

I haven't tried making it nice so I'm not sure if that'd help in this case. Possibly, but I guess that wouldn't eliminate issues regarding battery life on laptops anyway.

Revision history for this message
unggnu (unggnu) wrote :

It is very weird. On my Laptop with Pentium ULV 1,2 it seems to be fixed since some weeks but on a 386 installation with AMD64 3000+ it peaks every 5-8 seconds which results in highest CPU clock all the time without real load.

Revision history for this message
Justin Mason (jm-ubuntu) wrote :

Just to confirm, this is unpleasant behaviour: on my Dell laptop, apt-index-watcher's CPU spiking causes the fan to start up, then stop, every ~5 seconds. Killing apt-index-watcher fixes the problem and the fan has remained off since then.

Revision history for this message
Joachim Ziebs (texjoachim) wrote :

I can confirm this, too, with 0.3.9ubuntu5 on stable Edgy.

Revision history for this message
Thomas R. N. Jansson (tjansson) wrote :

Confirmed on Thinkpad X30 with edgy apt-get upgraded from dapper. Fully updated and running apt-index-watcher 0.3.9ubuntu5.

For now I just stopped it from starting all together:
chmod -x /etc/init.d/apt-index-watcher

Revision history for this message
infopipe (infopipe) wrote :

I can confirm the regular peaks in CPU usage caused by apt-index-watcher. After starting adept and closing it again (doing nothing with it) the peaks vanish.
If I can/should provide more information, let me know.

Revision history for this message
furlan (xtreme3xxx) wrote :

I've this problem with apt-index-watcher 0.3.9ubuntu5. If i disable it the cpu usage returns ok.

Revision history for this message
moelles (moelles) wrote :

i have a fresh edgy running for a few days...
today suddenly apt-index-watcher 0.3.9ubuntu5 shows this annoying behavior

Revision history for this message
thunderstorm (rainbow1612) wrote :

I can confirm that problem, too. apt-index-watch use 35-50% CPU-Load on my Vaio-Laptop with 2,8 GHz, every 2-5 seconds.

Revision history for this message
Arthur Schiwon (blizzz) wrote :

I can confirm it as well. On my machine (1,5 GHz, Kubuntu Edgy Eft) it uses more than 80% peak.

Revision history for this message
flarp (ralf-petter) wrote :

I can confirm this too. On my Laptop Apple Powerbook Pismo it runs every couple of seconds und the Laptop is very slow. When i kill apt-index-watcher performance is ok!

Revision history for this message
Giuseppe Cardone (ippatsuman) wrote :

I can confirm this bug too. On my systems (a Pentium M 1.4 GHz and a Pentium M 745 1.80 GHz, RAM 512MiB) with a freshly installed Kubuntu Edgy Eft apt-index-watcher uses 100% cpu-load every 3-5 seconds. This bug seems to appear randoml. Killing apt-index-watcher fixes the problem (but it's not a solution).

Revision history for this message
da1l6 (da1l6) wrote :

Same thing here. I really had a hard time finding out, what was causing the frequent CPU usage spikes.
The spikes are so short that neither ksysguard nor top list apt-index-watcher with a noteable cpu load value. I killed task by task to finally find out what was going on.

What the hell "apt-index-watcher" for? Does one really need it?

I made a screenshot from ksysguard, with the update intervall set to 2 seconds. The PC was not touched during the displayed time period

Using: Edgy Eft, apt-index-watcher 0.3.9ubuntu5

Revision history for this message
Risto H. Kurppa (risto.kurppa) wrote :

Confirmed here w. 0.3.9ubuntu5

r

Revision history for this message
moelles (moelles) wrote :

confirmed 0.3.9ubuntu5 on a fresh kubuntu edgy installation..

starting adept stops it but on next reboot the cpu-spikes come back again.

i cant just remove it because it would also remove kubuntu-desktop, etc...

i know you are working hard, but please consider giving this bug a higher priority.

Revision history for this message
Risto H. Kurppa (risto.kurppa) wrote :

I don't have adept installed (I removed it ;) though I'm running KDE so I cannot start &close it. Synaptic doesn't do the same but ps -Af|grep index -> kill the root process does it..

r

Revision history for this message
Brijam (brian-opensourcery) wrote :

Confirmed here as well on an HP zd7000 notebook with 0.3.9ubuntu5.

Revision history for this message
Daniel Frein (danielfrein) wrote :

simple workaround until updated packages are available: edit /etc/init.d/apt-index-watcher and insert a line just containing "exit 0" after line 1 and apt-index-watcher won't be started any more (at least not until you update the apt-index-watcher package - an updated package would recreate this file)

Revision history for this message
Neale Pickett (neale-lanl) wrote :

I moved pkgcache.bin and srcpkgcache.bin out of /var/cache/apt-index-watcher, and the CPU spikes vanished. The files were replaced with newer copies, and the new copies had the exact same md5sum as the old ones I moved out.

So I'm thinking that one could run:

$ sudo touch /var/cache/apt-index-watcher/*

but if that doesn't work, use rm instead of touch.

I glanced at the source code and it looked complex so I gave up. My total shot in the dark based on strace output is that something's checking a timestamp. If it sees the timestamp doesn't match the apt database, it does some expensive operation with the two files to determine whether or not update scripts should be run. This is fine, but it should adjust the modified timestamp on the files after doing the expensive operation.

I too am using kubuntu 6.10, apt-index-watcher is at 0.3.9ubuntu5. I have never run adept, I use aptitude exclusively.

Revision history for this message
Neale Pickett (neale-lanl) wrote :

Interesting. Trying to recreate the slowdown, I ran "aptitude update". A short time later (in minutes, I think) adept-notifier popped up. I needed to update GNU tar.

Revision history for this message
Rob Hasselbaum (rhasselbaum) wrote :

I just started seeing this today. This makes some time-sensitive apps suffer greatly (e.g. audio playback in a VMWare virtual machine).

Revision history for this message
Fabio Albieri (chareos) wrote :

Had same problem right now. Thankfully I found this bug report. I'm trying the "touch" thing. If it's no "solution" I'll come with more.

Revision history for this message
Jörg Menke (jhm-gmx) wrote :

I can confirm this, too.

$ sudo touch /var/cache/apt-index-watcher/*

worked fine for me. Let's see how long...

Revision history for this message
alf3 (alf3) wrote :

apt-index-watcher is adding an error message in syslog complaining of a missing file, this is what is taking up resources

Be sure to have the package debtags installed to stop this problem.

Revision history for this message
infopipe (infopipe) wrote :

for me there is no syslog message from apt-index-watcher and the debtags package is installed.
So this is no solution for me.
I run `sudo touch /var/cache/apt-index-watcher/*` every time I notice the spikes in CPU load and this stops it. Very inconvenient.

Revision history for this message
Elijah Lofgren (elijahlofgren) wrote :

THANK YOU alf3!

I was running into this problem and running the following command solved it:
sudo apt-get install debtags

While Upgrading to Ubuntu 6.10 using the update-manager I got the following:

Could not install 'debtags'

The upgrade aborts now. Please report this bug against the 'update-manager' package and include the files in /var/log/dist-upgrade/ in the bugreport.

subprocess post-installation script returned error exit status 1

I posted that in: https://bugs.launchpad.net/distros/ubuntu/+source/debtags/+bug/26007

But since I didn't notice anything wrong, I forgot about it.

I eventually noticed apt-index-watcher taking lots of CPU and am very glad I was able to fix it by running the following command:

sudo apt-get install debtags

Hope this helps someone,

Elijah Lofgren

Revision history for this message
Elijah Lofgren (elijahlofgren) wrote :

Ooops.

I meant that running the following command fixed my problem (notice the --reinstall):

sudo apt-get install --reinstall debtags

Revision history for this message
Lukáš Zapletal (lzap) wrote :

I confirm. Cant find anything in my logs. I have (re)installed debtags and see. Will you release some fix for this? Very annoying...

Revision history for this message
Andreas Scherf (scherfa) wrote :

Problem still exists here installed debtags 1.5.5ubuntu2 and apt-index-watcher is at 0.3.9ubuntu5
The index watcher runs and consumes cpu time .. isn't it better to remove it completely until this
bug is fixed ??

Revision history for this message
Ernst Kloppenburg (ernst-kloppenburg) wrote :

Just reinstalling did not seem to help one of the previous posters.

I tried
dpkg --purge --force-depends debtags
apt-get -f install

This seemed to cure the problem.

Revision history for this message
infopipe (infopipe) wrote :

Does not work for me.
I still have to run `sudo touch /var/cache/apt-index-watcher/*` every time I notice the spikes in CPU load.

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

I confirm this

after doing

sudo apt-get --reinstall install debtags apt-index-watcher

Revision history for this message
Brian Pitts (bpitts) wrote :

Confirmed in Kubuntu 6.10 dist-upgraded from 6.06.

Revision history for this message
sergioroa (s-roa) wrote :

I confirm this bug in Kubuntu 6.10, using apt-index-watcher 0.3.9ubuntu5 and adept 2.1.1ubuntu3

Revision history for this message
Andy Bovett (abovett) wrote :

My laptop (Dell SmartStep 250N) is prone to overheating with prolonged high CPU use. This bug is enough to force a thermal shutdown at times - VERY inconvenient. Surely it should be given a higher priority?

Revision history for this message
Neale Pickett (neale-lanl) wrote : Patch until this is fixed

Here's something to patch this until it's fixed upstream. This will add an hourly cron job that updates the timestamp on the two problematic files. Doing this prevents apt-index-watcher from spinning on my machine, and from the comments in this bug it works for others too.

Just paste the following into a terminal:

sudo uudecode <<'EOM'
begin 755 /etc/cron.hourly/apt-index-watcher-bug
M(R$@+V)I;B]S:`H*=&]U8V@@+W9A<B]C86-H92]A<'0M:6YD97@M=V%T8VAE
$<B\J"@``
`
end
EOM

To uninstall:

  sudo rm /etc/cron.hourly/apt-index-watcher-bug

Revision history for this message
Neale Pickett (neale-lanl) wrote : Same workaround as a downloadable file

The bug tracking system added spaces in front of each line of the previous comment (at least in Konqueror) so I've attached the patch.

You can install it with the following command:

$ sudo sh apt-index-watcher-bug.shar

Uninstall the same way as in the last comment:

$ sudo rm /etc/cron.hourly/apt-index-watcher-bug

Revision history for this message
Kurt J. Bosch (kujub-deactivatedaccount) wrote :

This seems to be fixed on feisty where apt-index-watcher seems to be removed completely.

Revision history for this message
Guillaume Martres (smarter) wrote :

Hi,
this bug should be marked as fixed, the problem does not exist anymore on feisty.

Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for the bug report. I'm closing it because the bug has been fixed in Feisty. It won't be fixed in 6.10 because the bug doesn't fit requirements for backporting. See https://wiki.ubuntu.com/UbuntuBackports for more information.

Changed in libapt-front:
status: Confirmed → Fix Released
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.