Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: update-mime-database has become agonizingly slow in recent weeks

  1. #1

    Default update-mime-database has become agonizingly slow in recent weeks

    At some point, I assume after an update in the last few weeks, the update-mime-database process has become agonizingly slow, taking 5 minutes or more to run. This is especially awful when running a system update that may call it multiple times.
    For example, today I ran my usual "zypper ref;zypper up;zypper ps -s" routine that I run when I boot my computers (yes I update manually from the command line, I like to see what's going on with updates). There were 142 updates today and update-mime-database was called by 7 of them. Each run took over 7 minutes! This made the updates take half an hour longer than they should have.
    I identified the problem recently by noticing individual updates seemed to hang. Looking in my processes I found that update-mime-database was running each time. While top and atop showed that update-mime-database was using minimal CPU and memory resources, it still seemed to hold up the whole system each time it was run as part of another update's update process.
    Once I finished my updates, I rebooted, let the system settle and ran update-mime-database manually with the following results.
    Code:
    # time /usr/bin/update-mime-database /usr/share/mime
    Unknown media type in type 'all/all'
    Unknown media type in type 'all/allfiles'
    
    
    real    7m14.810s
    user    0m0.736s
    sys    0m20.704s
    Seven minutes! Yikes.
    Is this a problem for anyone else?
    If so I'll put in a problem report. If not, any tips on diagnosing and repairing the issue with the update-mime-database program?
    Last edited by TheRealTachyon; 07-Dec-2016 at 16:14. Reason: typo

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,383
    Blog Entries
    1

    Default Re: update-mime-database has become agonizingly slow in recent weeks

    For reference, I can get that to complete in a few seconds as expected. You could try
    Code:
    mv /usr/share/mime /usr/share/old
    then force reinstall shared-mime-info
    Code:
    zypper in -f shared-mime-info
    That should help.
    Last edited by deano_ferrari; 07-Dec-2016 at 19:36.

  3. #3

    Default Re: update-mime-database has become agonizingly slow in recent weeks

    Hi, could you try the following (as a test only)?

    Code:
    export PKGSYSTEM_ENABLE_FSYNC=0
    time /usr/bin/update-mime-database /usr/share/mime
    Please report the amount of time this takes. Thanks!

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,383
    Blog Entries
    1

    Default Re: update-mime-database has become agonizingly slow in recent weeks

    Quote Originally Posted by qantas94heavy View Post
    Hi, could you try the following (as a test only)?

    Code:
    export PKGSYSTEM_ENABLE_FSYNC=0
    time /usr/bin/update-mime-database /usr/share/mime
    Please report the amount of time this takes. Thanks!
    Good suggestion. I note that there is a bug report describing this behaviour
    https://bugzilla.opensuse.org/show_bug.cgi?id=979301

    FWIW, this mailing list thread discussing the same for openSUSE 42.2 as well...
    https://lists.opensuse.org/opensuse-.../msg00244.html

  5. #5

    Default Re: update-mime-database has become agonizingly slow in recent weeks

    Thanks for the replies guys!
    The reference to the bugzilla report seems right on track. I'm going to try the test referenced by qantas94heavy as it's referenced in the bugzilla report that deano_ferrari posted.
    I'll have to do this tomorrow when I get back on the laptop in question.
    That post is interesting as it seems to have resolved the source of the issue without really fixing it globally. Instead relying on any package maintainers of packages that have the issue to fix it individually.
    Fortunately in my case, I logged the zypper up output of the last update so I can identify all seven packages that have the issue. I'll try and make reports for all of them and reference the original bugzilla report deano_ferrari listed in those reports.
    FWIW to future Googlers finding this thread, my desktop which is also running OpenSUSE Leap 42.1 does not exhibit this behaviour. The main difference between these two is that the desktop was installed fresh with Leap 42.1 while the laptop with the issue was distro updated from 13.2. I'm wondering if distro update doesn't properly replace some package scripts using the macros mentioned in the bugzilla report.

    Anyway, I'll update this thread with my findings and any resolution I come up with.
    Last edited by TheRealTachyon; 08-Dec-2016 at 02:16. Reason: typo

  6. #6
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,383
    Blog Entries
    1

    Default Re: update-mime-database has become agonizingly slow in recent weeks

    Quote Originally Posted by TheRealTachyon View Post
    FWIW to future Googlers finding this thread, my desktop which is also running OpenSUSE Leap 42.1 does not exhibit this behaviour. The main difference between these two is that the desktop was installed fresh with Leap 42.1 while the laptop with the issue was distro updated from 13.2. I'm wondering if distro update doesn't properly replace some package scripts using the macros mentioned in the bugzilla report.

    Anyway, I'll update this thread with my findings and any resolution I come up with.
    I can confirm that my laptop which was recently upgraded from 13.2 to Leap 42.2 is exhibiting the same behavior. I have Leap 42.1 running on my main laptop as a guest OS and that is not impacted.

    Code:
    # time /usr/bin/update-mime-database /usr/share/mime
    Unknown media type in type 'all/all'
    Unknown media type in type 'all/allfiles'
    
    real    1m3.722s
    user    0m0.567s
    sys     0m0.747s

  7. #7

    Thumbs up Re: update-mime-database has become agonizingly slow in recent weeks

    OK, so today I tried the FSYNC fix.
    First I tried it against a real update with,

    Code:
    # export PKGSYSTEM_ENABLE_FSYNC=0
    # zypper ref;zypper up;zypper ps -s
    There were several packages that called update-mime-database and no slowdown.

    Then I ran the manual timed test

    Code:
    # time /usr/bin/update-mime-database /usr/share/mime
    Unknown media type in type 'all/all'
    Unknown media type in type 'all/allfiles'
    
    
    real	0m1.156s
    user	0m0.608s
    sys	0m0.412s
    How's that for an improvement?!

    Gotta reboot after the updates....new kernel. Then I'm going to try force reinstalling the update mime package as was suggested and cross my fingers.

  8. #8

    Default Re: update-mime-database has become agonizingly slow in recent weeks

    Well....too much to hope for I guess... here's the output of the manual test after the forced shared-mime-info update.

    Code:
    # time /usr/bin/update-mime-database /usr/share/mime
    Unknown media type in type 'all/all'
    Unknown media type in type 'all/allfiles'
    
    
    real    4m31.483s
    user    0m0.780s
    sys    0m12.600s
    I guess for now my new update routine will be

    Code:
    # export PKGSYSTEM_ENABLE_FSYNC=0
    # zypper ref;zypper up;zypper ps -s

  9. #9

    Red face Re: update-mime-database has become agonizingly slow in recent weeks *RESOLVED*

    So today I booted up my laptop, intending to open a bug report case on this issue. First, however, I ran my usual updates but forgot to make the export. After waiting a long time for the updates due to several of them running the update-mime-database call, I rebooted.
    I got a notification that there were more updates. I ran those without the export as well and to my surprise there was no slow down even when update-mime-database was called twice.
    The shared-mime-info package has been updated and the problem is fixed! Big thanks to fezhang@suse.com


    Here's the changelog.



    shared-mime-info - Shared MIME Database

    Mon 14 Dec 2015 05:00:00 AM MST
    fezhang@suse.com
    - Disable fdatasync() during installation time or when
    PKGSYSTEM_ENABLE_FSYNC is set (bsc#862596) (fdo#70366)
    - Add shared-mime-info-disable-fdatasync-in-installation.patch
    Sat 21 Nov 2015 05:00:00 AM MST
    fezhang@suse.com
    - Backport the fix from openSUSE:Factory to fix the slow
    installation issue (bsc#862596)
    The original openSUSE changelog comment by hrvoje.senjan@gmail.com:
    - Export ac_cv_func_fdatasync=no before calling configure, to
    workaround the issue described in fdo#70366, where fdatasync()
    is called on each update-mime-database invocation

  10. #10
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,383
    Blog Entries
    1

    Default Re: update-mime-database has become agonizingly slow in recent weeks *RESOLVED*

    Quote Originally Posted by TheRealTachyon View Post
    So today I booted up my laptop, intending to open a bug report case on this issue. First, however, I ran my usual updates but forgot to make the export. After waiting a long time for the updates due to several of them running the update-mime-database call, I rebooted.
    I got a notification that there were more updates. I ran those without the export as well and to my surprise there was no slow down even when update-mime-database was called twice.
    The shared-mime-info package has been updated and the problem is fixed! Big thanks to fezhang@suse.com
    Thanks for the update! (I'll update my laptop running openSUSE 42.2 later today.)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •