You are not logged in.

#1 2015-06-16 13:44:18

icetonic
Member
From: Germany
Registered: 2008-10-21
Posts: 104

First start of any application slow, subsequent starts are fast?

I don't know whether this behaviour is present for the last few weeks or months, but I am sure that previously it was not that way.

The issue is that after a reboot, the first execution of ANY application takes multiple seconds / longer than usual, but then when I close the program and start it again, it is as fast as I am used to.

Did something change in the Kernel or Systemd? I don't know. But I know that it did not take a minute to start XMonad and my background applications and it did not take seconds for a terminal to open for the first time, etc.

This is really annoying. Does anyone know what might cause this? Thanks in advance!

EDIT: I suspect now that is has to do with read/write of my harddrive and that probably the next starts are fast because of some kind of caching? But I don't know what causes this and what to do about this..

EDIT2:
[20:27:36] admin@thinkpad ~ $ sudo hdparm -tT /dev/sda

/dev/sda:
Timing cached reads:   316 MB in  2.00 seconds = 157.99 MB/sec
Timing buffered disk reads:   4 MB in  3.56 seconds =   1.12 MB/sec

This does not look good. Even cached is slow. and I tried to backup a list of installed packages what normally is output instantly, now I can watch the terminal outputting one program after the other, one per second.... What is going on? yikes

Last edited by icetonic (2015-06-16 18:31:04)

Offline

#2 2015-06-16 15:06:06

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: First start of any application slow, subsequent starts are fast?

Unless you forcibly "clean" your RAM, the application data is caeched there, so the subsequent startup is much much faster, as it's not read from HDD, but from RAM.
You can use e.g. htop to monitor what's reading your drive, using cpu or ram.

Offline

#3 2015-06-16 18:00:18

icetonic
Member
From: Germany
Registered: 2008-10-21
Posts: 104

Re: First start of any application slow, subsequent starts are fast?

Thanks for your response! Well, I don't want to clean the cache, I want to understand why everything is so slow on the first start, as this is unusual.

Currently I am running the "extensive SMART test" for my harddrive and while it should take 95 minutes, it runs for more than two hours and is just at 30%, the short test (that said that everything is fine) also was running for more like 20 minutes than 5 as promised, so something seems very wrong to me.

hdparm -t /dev/sda also yields funny results sometimes, I get
Timing cached reads:   13076 MB in  2.00 seconds = 6541.44 MB/sec
Timing buffered disk reads: 320 MB in  3.00 seconds = 106.58 MB/sec

(which looks fine to me?) but sometimes buffered disk reads results in just 7 MB/s or less, which is frightening...

Is my HDD dying or can it still be a Kernel problem?

Last edited by icetonic (2015-06-16 18:00:40)

Offline

#4 2015-06-16 18:35:58

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: First start of any application slow, subsequent starts are fast?

Did you check power management values for the drive? Maybe it is spinning down very fast and has to spin up first which takes long.
Check the hdparm -{B,S,M} values. (https://wiki.archlinux.org/index.php/Hd … figuration)


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

#5 2015-06-16 18:48:23

icetonic
Member
From: Germany
Registered: 2008-10-21
Posts: 104

Re: First start of any application slow, subsequent starts are fast?

It should not be the case..

hdparm -B /dev/sda gives me a value of 128 and if it would spin up/down I would hear it (I tried playing with this when power-optimizing my laptop but decided against aggressive spin-down it in the end, because of lagging and to reduce the wear of the hard drive)

Offline

#6 2015-06-16 19:11:46

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: First start of any application slow, subsequent starts are fast?

Is there any process causing massive disk I/O ?
As you are running the extended test and di run the short test I assume your SMART attributes (smartctl -A ) are okay?
Guess we have to wait and see if the test brings up something


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

#7 2015-06-17 08:47:42

icetonic
Member
From: Germany
Registered: 2008-10-21
Posts: 104

Re: First start of any application slow, subsequent starts are fast?

The extensive test did not give anything new. Well, the relocation event count is at 60 which according to gsmartcontrol is a sign of upcoming failures. Also I put my drive into a different computer and had the same slow behaviour, and HDDScan Benchmarking resulted in regular speed drops to 1MB/s, which looks rather unhealthy..

I decided to buy a new hard drive before it is too late and reinstall Arch fresh on it. I'll report back when it is done...

Offline

Board footer

Powered by FluxBB