update-apt-xapi --- not nice!

Discussion in 'all things UNIX' started by vasa1, Nov 15, 2011.

Thread Status:
Not open for further replies.
  1. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,417
    When this commands runs it hogs CPU up to 100%. It happens to me on Ubuntu 11.10 and has been known to happen to others.

    I found two "fixes":
    http://naveenubuntu.blogspot.com/2011/10/ubuntu-update-apt-xapi-takes-lot-of-cpu.html
    and
    http://sapnwnewbie.blogspot.com/2010/11/high-cpu-usage-by-update-apt-xapi.html

    Comments, anyone?

    PS: I still have Synaptic as a carry-over from 11.04 because I upgraded. People who did a clean 11.10 install may not have Synaptic unless they subsequently installed it.
     
  2. linuxforall

    linuxforall Registered Member

    Joined:
    Feb 6, 2010
    Posts:
    2,137
    This issue is intense in my poor AMD C50 Netbook where the CPU gets taxed tgo 100% for a brief moment, however its no sweat for my i7 laptop or dual Xeon desktop.
     
  3. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,417
  4. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,417
    This POS seems to fire every Monday (at least). It ran for about 1 min 15 sec. I really don't like it!
     
  5. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,417
    Here's a link to a bug that implies that removing it doesn't end the world. And the good news is that it may not be present in 12.04 (according to a comment in the bug)!
     
  6. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,417
    But I think I saw it today :(
     
  7. iceni60

    iceni60 ( ^o^)

    Joined:
    Jun 29, 2004
    Posts:
    5,116
    hi, i had the same problem. i checked to see which fix i used, as update-apt-xapi runs very smoothly now. the fix i used was editting /etc/cron.weekly/apt-xapian-index

    Code:
    #!/bin/sh
    
    CMD=/usr/sbin/update-apt-xapian-index
    
    # ionice should not be called in a virtual environment
    # (similar to man-db cronjobs)
    egrep -q '(envID|VxID):.*[1-9]' /proc/self/status || IONICE=/usr/bin/ionice
    
    # Check if we're on battery
    if which on_ac_power >/dev/null 2>&1; then
        on_ac_power >/dev/null 2>&1
        ON_BATTERY=$?
    
        # Here we use "-eq 1" instead of "-ne 0" because
        # on_ac_power could also return 255, which means
        # it can't tell whether we are on AC or not. In
        # that case, run update-a-x-i nevertheless.
        [ "$ON_BATTERY" -eq 1 ] && exit 0
    fi
    
    # Rebuild the index
    if [ -x "$CMD" ]
    then
        if [ -x "$IONICE" ]
        then
            nice -n 19 $IONICE -c 3 $CMD --quiet
        else
            nice -n 19 $CMD --quiet
        fi
    fi
    NOTE this is on "Linux Mint 12 Lisa"
     
  8. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,417
    Hi & thanks. I will look at that. BTW, it doesn't look like having Synaptic installed or not is a factor. This is a totally clean 12.04 install, new /home new everything which doesn't have Synaptic.
     
  9. iceni60

    iceni60 ( ^o^)

    Joined:
    Jun 29, 2004
    Posts:
    5,116
    well, i don't know it seems if i read my linux posts from 5 years a go i knew what i was doing, now i'm at noob level lol. i tried these commands to no avail
    Code:
    sudo apt-cache show update-apt-xapi
    sudo apt-cache depends update-apt-xapi
    sudo apt-rdepends update-apt-xapi
    sudo debtree update-apt-xapi
    what makes me more depressed is Mrk and i started using linux at about the same time and i bet he comes a long with the right answer lol. still, i have vowed to start getting fit and reading a linux book every 2 weeks, so Mrk better watch his back :D
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.