Bug 1277940 - Upgrade extremely slow
Upgrade extremely slow
Product: Fedora
Classification: Fedora
Component: dnf-plugin-system-upgrade (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Will Woods
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-11-04 06:48 EST by Luca Giuzzi
Modified: 2016-12-20 10:21 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-20 10:21:47 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Luca Giuzzi 2015-11-04 06:48:15 EST
Description of problem:
 I have updated several machines using dnf to fedora 23.
 The number of installed packages (rpm -qa|wc) ranges between 4432 and 8296.
The upgrade worked sort of flawlessly (apart from problems with a dependency of systemd on one of the computers, but this was a fault of an external package) but it took an extremely long amount of time (more than 8 hours for the computer with 4432 packages and almost 10 for that with 8296) to install the various rpm's. This is, clearly, quite undesiderable.

The computers being involved were all quite old (intel core2duo or intel atom). The main filesystem is in 2 cases out of three btrfs, while in the remaining one is ext4

Version-Release number of selected component (if applicable):

Upgrade from F22 to F23

How reproducible:
 Try to upgrade a fully installed system

Steps to Reproduce:

Actual results:
 The upgrade ends after a very long time.

Expected results:
 The upgrade is faster.

Additional info:
Comment 1 Zbigniew Jędrzejewski-Szmek 2015-11-04 08:37:23 EST
Most of the work of the plugin is done by dnf. Installing packages is done entirely by dnf and rpm. Sometimes the installation may hang, usually when one of the pre/post-install scriptlets hangs. But since your installation finished successfully, this is most likely not the case here. During the upgrade 22→23 there is a number of packages which do significant work during upgrade, e.g. selinux and systemd. If there was some specific package that was causing the slowdown, we could reassign this bug to them, but if it is just "general" slowness, I'm afraid there's not much that can be done.

One thing that the distribution as a whole is doing, is moving to https://fedorahosted.org/fpc/ticket/566, which will make big transactions faster. This is a long-term process though.
Comment 2 Luca Giuzzi 2015-11-04 11:20:11 EST
Indeed, the installation eventually completed and the system appears to be in working order, so it has not been hung.

 What I suspect is that most of the time has been spent upgrading several tiny packages (like texlive-* and the inherent clean-up).
Actually,on the most underpowered machine (an atom N570 with the main filesystem on btrfs) it took something like 5 hours and 40 minutes to install the packages and 4 hours 30 minuts to do the clean-up.

Oddly enough in dnf.rpm.log the name of the packages occur either 2 or 3 times:

Nov 03 22:03:05 INFO --- logging initialized ---
Nov 03 22:07:06 INFO Upgraded: nss-sysinit-3.20.0-1.2.fc22.x86_64
Nov 03 22:07:06 INFO Upgraded: nss-sysinit-3.20.0-1.2.fc22.x86_64
Nov 03 22:07:13 INFO Upgraded: nss-3.20.0-1.2.fc22.x86_64
Nov 03 22:07:13 INFO Upgraded: nss-3.20.0-1.2.fc22.x86_64
Nov 03 23:41:10 INFO Upgraded: SDL-1.2.15-19.fc23.i686
Nov 03 23:41:10 INFO Upgraded: SDL-1.2.15-19.fc23.i686
Nov 03 23:47:13 INFO --- logging initialized ---
Nov 03 23:48:39 INFO --- logging initialized ---
Nov 03 23:58:23 INFO --- logging initialized ---
Nov 04 00:00:45 INFO Upgraded: libgcc-5.1.1-4.fc23.x86_64
Nov 04 00:00:45 INFO Upgraded: libgcc-5.1.1-4.fc23.x86_64
Nov 04 00:00:45 INFO Upgraded: libgcc-5.1.1-4.fc23.x86_64

[and then each package occurs thrice]

Still, I do not believe that this might be related to the time taken updating the system (even if it spams the log file).
Comment 3 Will Woods 2015-11-06 17:47:50 EST
Because of how RPM does upgrades, it takes much longer to upgrade a package than to install it fresh.
For each package that gets upgraded, here's (approximately) what happens:

1) RPM runs %pre scripts for the new package
2) RPM decompresses the new package and installs all the new files
3) RPM runs %trigger scripts that relate to the new/old packages
4) RPM runs %preun scripts for the old package
5) RPM cleans up non-config files from the old package
6) RPM checksums all the config files from old/new packages,
   creates .rpmsave/.rpmnew files if needed
7) RPM runs %postun scripts for the old package

Installation only needs to do item 1-3; package upgrades do all 7 (and probably some other stuff that I'm forgetting about.)

Upgrading 8,000 packages is just going to take a lot longer than installing 8,000 packages - and you probably didn't install all 8,000 packages initially, so the upgrade is always going to be *much* slower than your initial installation was.

So.. yes, upgrades are slow. But that's not caused by any defect in in dnf-plugin-system-upgrade, so there's nothing *I* can fix here.
Comment 4 Fedora End Of Life 2016-11-24 08:04:14 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Fedora End Of Life 2016-12-20 10:21:47 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.