LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slow program launch. Is this normal and how to fix it? (https://www.linuxquestions.org/questions/slackware-14/slow-program-launch-is-this-normal-and-how-to-fix-it-710153/)

ErV 03-08-2009 11:09 PM

Slow program launch. Is this normal and how to fix it?
 
Hello.

I have following problem:
Many programs take a lot of time to launch.
For example, Firefox (3.0.6) takes 15 seconds to start (first launch after boot), Opera (9.63) takes 15 seconds on first launch after boot (sequental launchs can be 3 seconds), kmail takes 3, kaffeine takes 3 seconds, k3b takes two seconds (that is until splashscreen appears) and so on. Basically it looks like everything that has something to do with gui is a bit slow to appear on screen.
Another interesting things that firefox frequently takes about 4 seconds or more to close and KDE frequently complains about that ("app not responding, terminate or keep running?") and after I press close firefox freezes until it disappears and doesn't repaint itself at that time.
Programs take a lot of time when they launched first time after system boot. Second/third/etc launch will be faster, but it is still a bit slow (2..3 seconds).

I think this is too long, for my system, and I'd like to know if such long time is normal, and if not, how it can be improved (personally, I'd like to have instant launch or less-than second start time). I think that something is not right because although firefox is always a bit slow, other "lighter" applications (kedit, kmail, etc.) should start much faster than they do it right now. (and I remember that everything was much faster in the past - I just don't know after which change things started to slow down).

My configuration:
Slackware 12.2
KDE 3.5.9
2.6.27.7 kernel (custom built, based on stock slackware configuration + some tweaks (high resolution timer + optimization for cpu))
AMD 64 X2 5000+ CPU (ondemand frequency governor enabled)
2GB Ram.
GeForce 8400 GS GPU with Nvidia 177.82 drivers.
HDD on which system is installed (ST380215A) is formatted into ext3, and has dma enabled (works in udma5 mode, multcount 16, unmaskirq is on)

Any ideas are welcome.
Thanks for your time.

guanx 03-09-2009 12:26 AM

Run firefox in a terminal emulator. DO you see SCIM starting?
If yes, see the end of the file "/etc/profile.d/scim.sh".

disturbed1 03-09-2009 05:08 AM

The closing time for Firefox is becoming a pain in my rear as well. I believe this is a new feature with the 3.x series. Seamonkey and Firefox 2.x do not have this issue. Launching on my systems is no where near as slow as yours, though Firefox is a pig and does take some time to launch.

Check your hard drive speeds. As root
hdparm -tT /dev/sda
Where /dev/sda is your actual disk. Perhaps you have the wrong module loaded. Using an older module for SATA drives instead of libata. Or using libata for unsupported chipsets.
On my slower system (AMD Sempron 3000+ PATA drives)
Code:

hdparm -tT /dev/hda

/dev/hda:
 Timing cached reads:  994 MB in  2.00 seconds = 496.72 MB/sec
 Timing buffered disk reads:  168 MB in  3.02 seconds =  55.60 MB/sec

On my faster system (Intel 8400 much better SATA drives)
Code:

hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:  9464 MB in  2.00 seconds = 4738.98 MB/sec
 Timing buffered disk reads:  230 MB in  3.02 seconds =  76.10 MB/sec

Your nVidia driver is out of date - update.
Quote:

Version: 180.22
Operating System: Linux x86
Release Date: January 8, 2009

Improved X pixmap placement on GeForce 8 series and later GPUs.
Improved stability on some GeForce 8 series and newer GPUs.
Improved compatibility with recent Linux kernels.


Version: 180.29
Operating System: Linux x86
Release Date: February 11, 2009

Nothing really new besides VDPAU fixes :)
Also try logging into Fluxbox to see if things are better.
And try running the default kitchen sink huge.smp stock Slackware kernel.

ErV 03-09-2009 10:57 AM

Quote:

Originally Posted by guanx (Post 3469247)
Run firefox in a terminal emulator. DO you see SCIM starting?
If yes, see the end of the file "/etc/profile.d/scim.sh".

No, I don't see SCIM starting, and there is no terminal output at all.
I use only two input langauges, and they both don't need scim to work.

Quote:

Originally Posted by disturbed1 (Post 3469430)
The closing time for Firefox is becoming a pain in my rear as well. I believe this is a new feature with the 3.x series. Seamonkey and Firefox 2.x do not have this issue. Launching on my systems is no where near as slow as yours, though Firefox is a pig and does take some time to launch.

As I mentioned, I know that firefox is slow by itself, and I am more concerned about other software taking too much time to launch. Even stuff like nvidia-settings and gqview doesn't appear instantly and take few seconds.

Quote:

Originally Posted by disturbed1 (Post 3469430)
Check your hard drive speeds. As root
hdparm -tT /dev/sda

As I said, drive has dma enabled and works in udma5 mode. So this is not a problem:
Code:

/dev/hdd:
 Timing cached reads:  1282 MB in  2.00 seconds = 641.45 MB/sec
 Timing buffered disk reads:  216 MB in  3.01 seconds =  71.77 MB/sec

It is IDE drive and it is probably fastest speed you can get from it.

Quote:

Originally Posted by disturbed1 (Post 3469430)
And try running the default kitchen sink huge.smp stock Slackware kernel.

To my experience default slackware kernel (not huge one, though) is seriously slower than current one, which is optimized for my CPU, so I think problem lies somewhere else. To me it looks like it has something to do either with HDD (library loading) or with X.

Quote:

Originally Posted by disturbed1 (Post 3469430)
Your nVidia driver is out of date - update.
...
Also try logging into Fluxbox to see if things are better.

I'll try that than I'll post results.

onebuck 03-09-2009 10:58 AM

Hi,

I rolled back to Firefox 2.x because of the molasses plugin for 3.x! :)

Really the gains for 3.x were not enough to waste the time so I rolled back to 2.x. I'll wait a while too see what happens with Mozilla until I attempt another upgrade.

FireFox 2.X meets my browser needs for now.

mostlyharmless 03-09-2009 11:08 AM

Definitely a version 3 problem for firefox. I'm still running version 2 under slack, which works well; my Win XP version is 3.06 and it makes IE look like greased lightning.

But you must have something else going on, my hardware is considerable slower than yours yet I don't see those kinds of delays in, for example k3b or nvidia settings.

H_TeXMeX_H 03-09-2009 11:34 AM

Quote:

Originally Posted by ErV (Post 3469762)
As I mentioned, I know that firefox is slow by itself, and I am more concerned about other software taking too much time to launch. Even stuff like nvidia-settings and gqview doesn't appear instantly and take few seconds.


As I said, drive has dma enabled and works in udma5 mode. So this is not a problem:
Code:

/dev/hdd:
 Timing cached reads:  1282 MB in  2.00 seconds = 641.45 MB/sec
 Timing buffered disk reads:  216 MB in  3.01 seconds =  71.77 MB/sec

It is IDE drive and it is probably fastest speed you can get from it.


To my experience default slackware kernel (not huge one, though) is seriously slower than current one, which is optimized for my CPU, so I think problem lies somewhere else. To me it looks like it has something to do either with HDD (library loading) or with X.


I'll try that than I'll post results.

The hdparm test suggests that the read rate is plenty fast, about as fast as my SATA drive, indeed that's probably the fastest you can get out of IDE.

Firefox 3.0.x is slow for me too, but not really 15 seconds, more like 10 sec., while 2.0.x was much faster in the 3-5 sec range same with mozilla/seamonkey. How long does mozilla take for you ? Other apps take from less than 1 sec to 2 sec, except KDE apps, which take a while, but I removed them.

Now, is anything else using the HDD ? Check the HDD usage and see if anything is constantly or repeatedly using the HDD.

App loading speed depends mostly on the HDD ... read / write rates, as well as the filesystem, and when disk usage is substantial (lots of reading and writing) then the I/O scheduler becomes important.

Woodsman 03-09-2009 12:27 PM

Firefox is hardly a good barometer. Firefox has always been slow starting because of the GTK-XUL design. I keep waiting for a QT version.

I have not liked Firefox 3.x at all, especially all the sqlite crap.

I suspect part of the startup delays with Firefox is dependent upon the add-ons installed.

Your start times and system are similar to mine. I have a dual core box with about the same startup times.

I'm not using SCIM.

I used to compare software startup times to NT4, which I still maintain on an older box. Everything on NT4 starts almost immediately. Nothing in KDE starts almost immediately.

Using a different desktop or window manager is not a solution because in any other environment, all of the KDE libraries must first be loaded, which increases startup times.

ErV 03-09-2009 01:53 PM

Quote:

Originally Posted by disturbed1 (Post 3469430)
Your nVidia driver is out of date - update.

Updated to 180.29 - no noticeable improvement. (Except than I noticed opera complaining about "X Shared memory extension is not available. ZPixmap not supported").

Quote:

Originally Posted by disturbed1 (Post 3469430)
Also try logging into Fluxbox to see if things are better.
And try running the default kitchen sink huge.smp stock Slackware kernel.

AFAIK, fluxbox is not included in slackware by default. In blackbox there is no noticeable improvement - first launch of opera/firefox still takes up to 15 seconds, second/third/etc launch is considerably faster (3x times), but still not instant. I suppose this is because of filesystem caching.

I'll try disabling cpu frequency governor.

Quote:

Originally Posted by onebuck (Post 3469765)
Hi,

I rolled back to Firefox 2.x because of the molasses plugin for 3.x! :)

Really the gains for 3.x were not enough to waste the time so I rolled back to 2.x. I'll wait a while too see what happens with Mozilla until I attempt another upgrade.

FireFox 2.X meets my browser needs for now.

Well, I'll consider rolling back to 2.x, but I think 3.x fixed one or two annoying bugs in 2.x gui (something related to keyboard shortcuts, I think), so I'm not sure about that. And it still won't explain why nvidia-settings and gqview take 2 seconds to launch.

Quote:

Originally Posted by H_TeXMeX_H (Post 3469804)
The hdparm test suggests that the read rate is plenty fast, about as fast as my SATA drive, indeed that's probably the fastest you can get out of IDE.

Despite enabled dma I have impression that everything that accesses disk produces noticeable system-wide slowdown, which could explain slow start of applications. For example, here is ksysguard graph for "dd if=/dev/zero of=1.bin bs=1M count=2048".
Maybe something is "wrong" with ext3 mount options and can be improved?:
Code:

/dev/hdd1        /                ext3                defaults        1  1
/dev/hdd2        swap            swap        defaults        0  0

Quote:

Originally Posted by H_TeXMeX_H (Post 3469804)
Firefox 3.0.x is slow for me too, but not really 15 seconds, more like 10 sec., while 2.0.x was much faster in the 3-5 sec range same with mozilla/seamonkey. How long does mozilla take for you ?

First launch of seamonkey takes 8 seconds. Second launch takes 3 seconds.

Quote:

Originally Posted by H_TeXMeX_H (Post 3469804)
Now, is anything else using the HDD ? Check the HDD usage and see if anything is constantly or repeatedly using the HDD.

Nothing heavily uses HDD, but something with heavy hdd (md5sum of large file) usage will increase startup times (it will take 2x..4x times longer)

Quote:

Originally Posted by Woodsman (Post 3469852)
all the sqlite crap.

Could you explain(curious)? I've seen bunch of sqlite databases in ff3 folders.

Quote:

Originally Posted by Woodsman (Post 3469852)
I suspect part of the startup delays with Firefox is dependent upon the add-ons installed.

Only two addons: adblock plus and stumbleupon toolbar.

Quote:

Originally Posted by Woodsman (Post 3469852)
Your start times and system are similar to mine. I have a dual core box with about the same startup times.

Now this is bad news. Can situation be improved somehow?

disturbed1 03-09-2009 02:22 PM

Quote:

Originally Posted by ErV (Post 3469949)
Updated to 180.29 - no noticeable improvement.

That's not good, as there are huge speed ups with 8+ series cards. Then again, it is mostly for KDE 4, and gaming.

Quote:

AFAIK, fluxbox is not included in slackware by default. In blackbox there is no noticeable improvement - first launch of opera/firefox still takes up to 15 seconds, second/third/etc launch is considerably faster (3x times), but still not instant. I suppose this is because of filesystem caching.
Sure it is :)
http://packages.slackware.it/search....&t=1&q=fluxbox
No reason to try flux, if BB doesn't improve anything.

Quote:

Despite enabled dma I have impression that everything that accesses disk produces noticeable system-wide slowdown, which could explain slow start of applications. For example, here is ksysguard graph for "dd if=/dev/zero of=1.bin bs=1M count=2048".
Maybe something is "wrong" with ext3 mount options and can be improved?:
Code:

/dev/hdd1        /                ext3                defaults        1  1
/dev/hdd2        swap            swap        defaults        0  0


My CPU pegs to 100% with PATA, and 60% with SATA.
dd if=/dev/zero of=1.bin bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 29.6432 s, 72.5 MB/s

For pata
2147483648 bytes (2.1 GB) copied, 39.8727 s, 53.9 MB/s

I use JFS, not EXT3. Here's a link on tweaking ext3 http://www.paulgraydon.co.uk/geeky/t...t3-mountpoint/

Quote:

Now this is bad news. Can situation be improved somehow?
Try prelink and/or preload?

But I still believe something else is at play here. My AMD 3000+ with an Nvidia 6200 and newest Nvidia drivers is no where near as slow as your machine with KDE 4. My Intel 8400 (Nvidia 7600) is just about instant with KDE 3.10. Sometimes in Fluxbox I believe the system has ESP :D.

What's your motherboad make and model? There are problematic chipsets and controller cards out there.

Is this only an issue with Slackware? Are other distros quicker? If the other distro(s) is quicker copy your .config file over and try your kernel with that distro.

H_TeXMeX_H 03-09-2009 02:27 PM

Quote:

Originally Posted by ErV (Post 3469949)
Despite enabled dma I have impression that everything that accesses disk produces noticeable system-wide slowdown, which could explain slow start of applications. For example, here is ksysguard graph for "dd if=/dev/zero of=1.bin bs=1M count=2048".
Maybe something is "wrong" with ext3 mount options and can be improved?:
Code:

/dev/hdd1        /                ext3                defaults        1  1
/dev/hdd2        swap            swap        defaults        0  0


First launch of seamonkey takes 8 seconds. Second launch takes 3 seconds.


Nothing heavily uses HDD, but something with heavy hdd (md5sum of large file) usage will increase startup times (it will take 2x..4x times longer)

fstab entry looks normal. Maybe you should try another I/O scheduler, it might help when multiple apps are trying to access the HDD, sometimes even just one app.

So run this:
Code:

bash-3.1$ cat /sys/block/hdd/queue/scheduler
noop anticipatory [deadline] cfq

(right now deadline is being used ... it is in brackets [])

Now try out some of them, you can do so on-the-fly, just echo the name of the scheduler into that file as root:

Code:

echo cfq > /sys/block/hdd/queue/scheduler
Try em out and see if you get better results with a different scheduler. I've gotten better results with deadline, and very poor results with CFQ ... it somehow was implicated in stuttering of movies and audio during playback, that suggests inefficiency ... but it also depends on the filesystem, so they're kinda interconnected.

ErV 03-09-2009 02:57 PM

Quote:

Originally Posted by disturbed1 (Post 3470001)
That's not good, as there are huge speed ups with 8+ series cards. Then again, it is mostly for KDE 4, and gaming.

Well, there might be speedup while program is running or in 3D graphics, but it doesn't make programs start faster.

Quote:

Originally Posted by disturbed1 (Post 3470001)
My CPU pegs to 100% with PATA, and 60% with SATA.
dd if=/dev/zero of=1.bin bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 29.6432 s, 72.5 MB/s

For pata
2147483648 bytes (2.1 GB) copied, 39.8727 s, 53.9 MB/s

On my system it is considerably slower:
Code:

2048+0 records in
2048+0 records out
2147483648 bytes (2,1 GB) copied, 93,2726 s, 23,0 MB/s

Quote:

Originally Posted by disturbed1 (Post 3470001)
I use JFS, not EXT3. Here's a link on tweaking ext3 http://www.paulgraydon.co.uk/geeky/t...t3-mountpoint/

Quote:

Originally Posted by disturbed1 (Post 3470001)
Try prelink and/or preload?

I will check it out.

Quote:

Originally Posted by disturbed1 (Post 3470001)
your machine with KDE 4.

I am using KDE 3.5.9, not KDE 4.

Quote:

Originally Posted by disturbed1 (Post 3470001)
What's your motherboad make and model? There are problematic chipsets and controller cards out there.

GA-M55Plus-S3G. This one, I think (not sure about revision, but I think it is 3.0).

Quote:

Originally Posted by disturbed1 (Post 3470001)
Is this only an issue with Slackware? Are other distros quicker? If the other distro(s) is quicker copy your .config file over and try your kernel with that distro.

Trying another distribution isn't possible at the moment - no space to store backup (5 GB out of 80 is free on the / right now) and no identical hardware nearby. Haven't been using anything besides slackware for at least 1.5 years, so can't compare. As I remember slackware was faster than other things I tried at that time (Suse 10.2, Asp Linux 11, Mandriva 2007), especially after recompiling kernel with CPU optimization, but this was long time ago (it was Slackware 11.0, right now I'm using 12.2).

Quote:

Originally Posted by H_TeXMeX_H (Post 3470012)
Maybe you should try another I/O scheduler, it might help when multiple apps are trying to access the HDD, sometimes even just one app.

Will try that.

H_TeXMeX_H 03-09-2009 03:58 PM

That dd test is not as clear a benchmark as you might think, it's not a linear relationship:

Code:

bash-3.1$ dd if=/dev/zero of=1.bin bs=256k count=20
20+0 records in
20+0 records out
5242880 bytes (5.2 MB) copied, 0.0036368 s, 1.4 GB/s
bash-3.1$ dd if=/dev/zero of=1.bin bs=256k count=200
200+0 records in
200+0 records out
52428800 bytes (52 MB) copied, 0.0474118 s, 1.1 GB/s
bash-3.1$ dd if=/dev/zero of=1.bin bs=256k count=500
500+0 records in
500+0 records out
131072000 bytes (131 MB) copied, 1.03324 s, 127 MB/s
bash-3.1$ dd if=/dev/zero of=1.bin bs=256k count=1000
1000+0 records in
1000+0 records out
262144000 bytes (262 MB) copied, 3.90386 s, 67.1 MB/s
bash-3.1$ dd if=/dev/zero of=1.bin bs=256k count=2000
2000+0 records in
2000+0 records out
524288000 bytes (524 MB) copied, 10.711 s, 48.9 MB/s
bash-3.1$ dd if=/dev/zero of=1.bin bs=256k count=5000
5000+0 records in
5000+0 records out
1310720000 bytes (1.3 GB) copied, 33.0129 s, 39.7 MB/s

The hdparm -tT is the most consistent test.

ErV 03-09-2009 04:08 PM

Quote:

Originally Posted by disturbed1 (Post 3470001)
Try prelink and/or preload?

I won't use prelink, but preload looks interesting.

Quote:

Originally Posted by H_TeXMeX_H (Post 3470012)
fstab entry looks normal. Maybe you should try another I/O scheduler, it might help when multiple apps are trying to access the HDD, sometimes even just one app.

Right now hdd uses cfq, I'll try "deadline" and write what happens.
--EDIT--
"Deadline" didn't help.
Firefox launch after "cold boot" took 20 seconds, opera - 10, kmail - 7.
--EDITtt--
disabling frequency governor didn't help. 18 seconds first launch in firefox, 10 seconds opera, 5 seconds kmail, 2.5 seconds nvidia-settings.

Any other ideas besides using preload?

H_TeXMeX_H 03-10-2009 05:14 AM

Try "anticipatory".


All times are GMT -5. The time now is 08:51 AM.