Bug 332239

Summary: YaST2 software management is still slow
Product: [openSUSE] openSUSE 11.0 Reporter: Andras Mantia <amantia>
Component: libzyppAssignee: Michael Andres <ma>
Status: RESOLVED FIXED QA Contact: Duncan Mac-Vicar <dmacvicar>
Severity: Normal    
Priority: P5 - None CC: linuxadmin, Markus.Elfring
Version: Alpha 2   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 10.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Yast logs

Description Andras Mantia 2007-10-09 15:23:38 UTC
I find the startup of YaST software management module (qt gui) still very slow. On my AMD64 3200+, 2 GB RAM, quite fast Seagate SATA HDD, it takes one and half minute. I have some community repos enabled[*], but I disabled my net connection so it doesn't download anything which could take time. From the dialogs it shows reading the cache is slow.

[*]
openSUSE-10.3-DVD - from DVD (disabled)
KDE::Community (enabled)
Games (action) (enabled)
Main Repository (OSS) (enabled)
VideoLan (disabled)
KDE:Backports (enabled)
Education:desktop (enabled)
Packman (enabled)
openSUSE-10.3-DVD - from ISO on the HDD (enabled)
Main Update (enabled)
NVIDIA (enabled)
X11:XGL (enabled)
Wine CVS Builds (enabled)
Comment 1 Andras Mantia 2007-10-09 15:31:00 UTC
Created attachment 177143 [details]
Yast logs
Comment 2 Duncan Mac-Vicar 2007-10-11 10:36:11 UTC
I have similar amount of repositories and I don't need that much time to read the cache unless some cache needs to be dropped and rebuilt.

Can you also try zypper and see if there is some difference in time? Pehaps YaST is doing something else.

And then,

Can you follow these instructions and see if it helps?

http://en.opensuse.org/SDB:Speed_up_Package_Manager_Stack

Please do all tests with zypper. It will be easy to see where the problem is.
Comment 3 Andras Mantia 2007-10-11 18:07:58 UTC
Here are my test results. The difference is that I changed my CPU to a dual-core Opteron, the rest of the system is the same. I didn't know what zypper command to use, so I used "zypper lu" as Marcus Meissner did.
During the test the network was brought down, to avoid downloading updates (in YaST this meant clicking OK & Skip). In YaST I counted the time from when I click on the Software Management icon until all messages/dialog boxes disappear, so I can use it:

1) Cold cache, PC rebooted:
- YaST - 1st run: 1 minute 30 seconds
- YaST - following runs: 38 seconds
- zypper lu (after running YaST for a few times): 
real    0m7.843s
user    0m6.592s
sys     0m1.180s

2) Cleaning the sqlite database as suggested:
- YaST: 37 seconds
- zypper lu: 
real    0m7.330s
user    0m6.200s
sys     0m1.144s

3) Rebuild the RPM database:
- YaST: 34 seconds
- zypper lu:
real    0m7.938s
user    0m6.616s
sys     0m1.288s

4) Brought the network up, so I don't click inside YaST:
- YaST: 40 seconds
- zypper lu:
real    0m15.954s
user    0m14.057s
sys     0m1.908s


Here is the complete output of the last zypper lu command:
time zypper lu
* Reading repository 'openSUSE BuildService - KDE:Community' cache
* Reading repository 'openSUSE BuildService - Games (action)' cache
* Reading repository 'Main Repository (OSS)' cache
* Reading repository 'openSUSE BuildService - KDE:Backports' cache
* Reading repository 'Education:desktop' cache
* Reading repository 'Packman Repository' cache
* Reading repository 'openSUSE-10.3-DVD 10.3' cache
* Reading repository 'Main Update Repository' cache
* Reading repository 'NVIDIA Repository' cache
* Reading repository 'openSUSE BuildService - X11:XGL' cache
* Reading repository 'openSUSE BuildService - Wine CVS Builds' cache
* Reading installed packages [100%]

Repository:            | Name               | Version | Category    | Status
-----------------------+--------------------+---------+-------------+-------
Main Update Repository | hugin              | 4518-0  | security    | Needed
Main Update Repository | kernel             | 4503-0  | security    | Needed
Main Update Repository | km_drm             | 4484-0  | security    | Needed
Main Update Repository | libiniparser-32bit | 4488-0  | optional    | Needed
Main Update Repository | smartmontools      | 4517-0  | recommended | Needed
Main Update Repository | zypper             | 4530-0  | recommended | Needed

real    0m15.954s
user    0m14.057s
sys     0m1.908s


So yes, zypper is much faster in all cases. None of the suggested speedups did really help with zypper, but it helped a little with YaST. But with YaST the startup is still slow. With cold cache it is VERY slow.

Let me know what kind of tests (or logs/outputs) you would like to see.
Comment 4 Andras Mantia 2007-10-11 18:13:49 UTC
I also did:
rm /var/cache/zypp/zypp.db ; zypper refresh

YaST: 22 seconds
zypper lu:
real    0m15.975s
user    0m13.905s
sys     0m2.056s


This is what really helped a lot, but I'm still worried about the performance on slower systems.
Comment 5 Andras Mantia 2007-10-11 18:49:06 UTC
And the last one after a reboot, now starting with zypper (network is up):

first run:
real    0m45.953s
user    0m13.549s
sys     0m1.784s

second run:
real    0m14.940s
user    0m13.397s
sys     0m1.528s


yast: 39 seconds
Comment 6 Duncan Mac-Vicar 2007-10-31 14:31:07 UTC
We will make small speed enhancements in 10.3 but the next bunch of bug improvements will come with 11.0, so it does not make sense to keep this bug open, however, we accept any patch for improvements as attachments here.
Comment 7 Andras Mantia 2007-11-09 13:05:56 UTC
Closing a report because you *might* make speed improvements in the next release is weird, but this isn't the only time I see such thing in openSUSE bug management. :( 
In normal case I'd close this report once the 11.0 version *is* available (at least in factory) and it fixes the slowness.
Comment 8 Duncan Mac-Vicar 2007-11-09 16:00:56 UTC
I will move to openSUSE 11.0 then.
Comment 9 Andras Mantia 2007-11-09 16:06:24 UTC
Thank you. :)
Comment 10 Ivan G Shevchenko 2007-12-16 14:45:17 UTC
*** Bug 346630 has been marked as a duplicate of this bug. ***
Comment 11 Ivan G Shevchenko 2007-12-16 14:49:57 UTC
from the duplicate bug 346630:

I have a subjective impression, that the performance of the process is
anti-proportional to the amount of changes (in each repository).

Isn't it possible, just to DELETE the cache of a changed repository?
(Therefor, each repo would need own DB)
Comment 12 Duncan Mac-Vicar 2007-12-16 20:53:04 UTC
Yes, that is being working on for next version, but using a different format for the cache.

sqlite is pretty bad at fragmentation, and we should had kept the repositories separated.

Comment 13 Ivan G Shevchenko 2007-12-17 16:01:24 UTC
Will the next version be available for 10.3?

It this the place to get it?
http://download.opensuse.org/repositories/YaST:/SVN/SUSE_Factory/

And it is safe to update current yast to that version?

Thanx!
Comment 14 Michael Andres 2008-04-15 10:34:56 UTC
IMO we can close this, as 11.0 is a bit faster.
Comment 15 Duncan Mac-Vicar 2008-04-16 09:30:42 UTC
For 10.3 you can use

http://download.opensuse.org/repositories/YaST:/Backport/openSUSE_10.3
http://download.opensuse.org/repositories/zypp/Backport/openSUSE_10.3

at your own responsability. You may end with a completely broken system (it works fine for me though)