# All my applications start after ~10+ second delay [solved]

## gnat79

I've just upgraded to modular Xorg about two weeks ago, and now all my programs take a long time to start. I use xfce4 and I watch the cpu graph when I click the button to launch the appllication. It does it even if you start it from a terminal. For instance, I just started acroread from a terminal and it took 25 seconds and the all of a sudden it popped up. Now if I start it again it starts very quickly, like I would expect. So, most of the time it's the applications that I start the first time, and it's not just per x-session, it is for each time I boot up. (I mean, I can log into a different user and start the application quickly if I started it as the first user).

I'm guessing this is a configuration of my system, but I don't even know where to start looking. Could someone give me some wild suggestions? I am running kernel-2.6.17-gentoo-r7 that I compiled myself on a pentium 4 dell optiplex gx270. I will happily post any files you think would help diagnose the situation. 

Thanks very much!

----------

## desultory

 *gnat79 wrote:*   

> I'm guessing this is a configuration of my system, but I don't even know where to start looking. Could someone give me some wild suggestions?

 

One wild suggestion: check the available data rate of the drive on which the OS and programs are resident (using, for example, hdparm -tT $device).

----------

## Redhot

Check your /etc/hosts

I had similar problem.

----------

## gnat79

Will do the checks. The thing is, this is a new problem, just recently started after updating my kernel, and system. I also upgraded gcc profile, but I doubt that had anything to do with it. 

What do you suggest I check in /etc/hosts? I'm not sure what to look for in there that might be the cause of problems. 

Anyway, right now I can't get at the computer, so I'll post back tomorrow when I have looked at it.

Thanks for the suggestions you guys.

----------

## bollucks

Check you haven't dropped your IDE drivers during building your own kernel and are running without dma access.

----------

## Redhot

 *gnat79 wrote:*   

> Will do the checks. The thing is, this is a new problem, just recently started after updating my kernel, and system. I also upgraded gcc profile, but I doubt that had anything to do with it. 
> 
> What do you suggest I check in /etc/hosts? I'm not sure what to look for in there that might be the cause of problems. 
> 
> Anyway, right now I can't get at the computer, so I'll post back tomorrow when I have looked at it.
> ...

 

After full system update everything started to working slower, very slow. FF was starting about 30 sec. X - 20 sec. My friend told me to check /etc/hosts file.

By chance i etc-updated /etc/hosts and this file wasn`t right. I repaired it and now everything work very fast  :Smile: 

----------

## boniek

Also after every major system/world update run revdep-rebuild to kep your system sane.

----------

## gnat79

I've taken care of revdep-rebuild. Also, I checked /etc/hosts. I didn't see a problem there. 

 *Quote:*   

> 
> 
> Check you haven't dropped your IDE drivers during building your own kernel and are running without dma access.
> 
> 

 

I'm checking that. It looks like I kept the same options except for one thing, so I'm recompiling the kernel. Let's see if it does any good....

... nope it didn't work.

I'll do more research. I bet it is something with the new kernel.

----------

## bollucks

Yeah but is dma working or not?

----------

## gnat79

How do I tell if dma is working?

----------

## desultory

```
hdparm $device
```

----------

## jph_void

i guess its dma, the disk cach can deliver fast access to preloaded data but acces to the disk is slower because it lacks dma.

```

# hdparm -I /dev/hda

DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 *udma4 udma5

* means dma is active and dma mode is udma4

% hdparm -d /dev/hda

/dev/hda:

 using_dma    =  1 (on)

# hdparm -t /dev/hda

for performance test

# hdparm -d1 /dev/hda

will active dma if not set

Check dma is active after reboot, you can edit local.sart script by adding 

something like :

/sbin/hdparm -q -d1 /dev/hda

/sbin/hdparm -q -d1 /dev/hdc

```

Hope this help.

----------

## desultory

Another option for retaining hdparm settings across reboots is to add the hdparm service to the boot runlevel and add the settings you want used to /etc/conf.d/hdparm.

----------

## gnat79

Hey guys,

Here is the result of a few of those commands:

# hdparm -I /dev/hda

```

DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5

```

# hdparm -d /dev/hda 

```

/dev/hda:

 using_dma    =  1 (on)

```

# hdparm -t /dev/hda

```

/dev/hda:

 Timing buffered disk reads:  168 MB in  3.01 seconds =  55.77 MB/sec

```

It looks like dma is working fine? I suppose, from this that it is. I'm going to do some more checking. For example, I have two kernels on here, so I'm going to try the old one to see if there is a problem. I don't know why I didn't do that already...

----------

## gnat79

Ok, so it's not the kernel. It must be something that I updated. I am having the same problem with the old kernel. Well, it might be the kernel and something configured differently. 

Can you check my dma output and see that it looks fine? Also, I'm not going to mess with any conf files until I need to, and I think I don't need to at this point.

The things I updated recently are that I moved to modular xorg and I updated gcc from something old to 4.1.1. 

I'm using  linux-2.6.17-gentoo-r7 as my kernel and xfce4. 

Ummmm...... Hmmmmm..... Scratch scratch. Well, I hope some of you will see this and give me some more feedback. 

Thanks for all the help so far. I really appreciate it!

----------

## gnat79

I found this in dmesg:

```

ReiserFS: hda6: found reiserfs format "3.6" with standard journal

ReiserFS: hda6: warning: CONFIG_REISERFS_CHECK is set ON

ReiserFS: hda6: warning: - it is slow mode for debugging.

ReiserFS: hda6: using ordered data mode

```

Is it normal to use slow mode for debugging?

----------

## Fukai

Check if fontconfig is configured correct (look to cache settings) i got problems with this other day,.

----------

## gnat79

 *Quote:*   

> Check if fontconfig is configured correct (look to cache settings) i got problems with this other day,.

 

I don't know what to do. Do you mean fontconfig in the kernel? What about the cache settings? I'm sorry I'm just not that familiar with this stuff!

Thanks!

----------

## bollucks

 *gnat79 wrote:*   

> I found this in dmesg:
> 
> ```
> 
> ReiserFS: hda6: found reiserfs format "3.6" with standard journal
> ...

 

For debugging it is normal but only if you have a problem. In this case this is almost certainly YOUR problem  :Smile:  ie get RID of it; it's slowing down your filesystem access.

----------

## gnat79

bollucks:

I hate to sound dumb, but I'm not sure exactly what you meant by your last comment. Should I disable debugging? Or did you simply mean there is some problem with my system other than that which is causing the slowdown?

Thanks

----------

## Zentoo

bollucks is right !  :Wink: 

just reconfig your kernel to have the following in your kenel configuration file:

```
# CONFIG_REISERFS_CHECK is not set
```

that should do something like it under make x/g/menuconfig:

```
<*> Reiserfs support

     [ ]   Enable reiserfs debug mode

     [ ]   Stats in /proc/fs/reiserfs
```

After recompile and reboot on your new kernel, everything should be fine. I'm confident  :Smile: 

BTW, check if you have not other debug stuff in your kernel with this:

```
cat /usr/src/linux/.config | grep DEBUG
```

You should have just commented lines. If not you have to unselect corresponding switch in your config.

----------

## gnat79

Word. Thanks y'all. I'm glad someone knows this stuff. I actually just read the comments in the menuconfig and it says something like "almost everyone should say no unless you're a Reiser developer"... dunno why I had it in there to start with.

Will rebuild and post results soon.

Thanks.

----------

## gnat79

Ok, I think I have it all figured out, solved, done etc. 

Thank you all for helping me! I hope one day to be able to pass it along.

----------

## Zentoo

No problem mate. It's why I love the Gentoo community.   :Razz:  Help one people is a way to help several people !

  BTW, I answer your post and few others while waiting the compilation of my own new kernel.   :Wink: 

----------

## Gentree

now I'll tell you another reason why your system is slow .... reiserfs. 

reiserfs fragments badly with use and this causes terrible slow downs. When I first hit this a few years back I saw everything taking a while to start. There's no defrag so you'll need to copy the whole partition or tar/untar it to restructure the files.

While you are there I suggest dumping reiserfs.

Reiser4 does most of what reiserfs was _though_ to do , and more. I love it.

If you want to stick with std. supported kernel fs I'd recommend goodole ext3.

If you're one of those who has everything on one, huge partition you are about to find out how inflexible that is.

If not just boot to a live CD , create a new partition big enough and copy all across.

cp -ax

man cp  if in doubt.

If that partition is a few months old you should see a significant speed up.

HTH.   :Cool: 

----------

