Postcards from the Fridge

Tuesday, July 18, 2006

Startup Variability

I've figured out why the nautilus startup times are so variable.

I removed both the window manager AND gnome-panel from the startup sequence to do my testing. I figure if I can remove the variability when only launching nautilus, then I should be able to add back in the others and make sure that things don't break.

WHAT?

Even with gnome-session ONLY launching nautilus in the gnone-session file, nautilus still has highly variable startup times.

gnome-session starts a whole bunch of things internally, and then launches nautilus.

NOTE: I am currently running with ALL of the stracing turned on, so times may be slower than previous blog posts.

Example:



Here's the same thing sorted:


Look at how different the best and worst times are....

WHY?
gnome-session launches a whole bunch of things asynchronously. Nautilus starts a whole bunch of things asynchronously. These are all racing to finish, and some depend on each other.

Fastest run:




Slowest run:


Notice how a WHOLE bunch of processes startup between when nautilus first loads and the first icon is painted on the screen. (icon_container expose_event)

If we could prevent nautilus from blocking, or at least let it show something on the screen before all of these other threads start, things would be much more consistent.

NOTE: This totally sucks. Blogger is shrinking my pictures. My flicker account won't let me show the whole version unless I go "pro". I'll probably do that anyway.

Until I figure out what to do, simply look for the "red" in the picture. It indicates where new daemons were launched (exec'd). When they happen early in the run, it means that the nautilus startup is interrupted. When they happen late, it means that nautilus completed before they start.

What to ask?

The questions that I really want to answer are:
  1. Why does nautilus block during startup? How can we stop it from blocking?
    (It looks as if it is waiting for other pieces of gnome to startup)

  2. What daemons have to be pre-started for nautilus to begin instantly? (or another way of looking at this is: What are dependencies does nautilus have on other pieces of gnome?)
    It looks like gnome-volume-manager and gnome-vfs-daemon need to be started early.

  3. How can the dependencies be started before everything else?
How do we answer these questions?
  1. Read through the raw strace logs.
    This is pretty helpful, but it is alot of data. I have to study exactly what the nautilus threads were doing when they yielded the CPU. It would be really nice if we could record when a process/thread is switched off of the CPU.
  2. Extend Federico's visualization tool to show the interesting information
    I've currently extended it to show futex information, but it really generates an enormous image, and is very hard to see what is going on. However, I think it would be useful to somehow show the parent/child relationship for some of the processes. This would help determine the dependencies.. However, maybe this should be a different tool.
  3. The NPTL trace tool
    I just stumbled upon this, and I'm hopeful that this will give me some idea about how the various gnome threads interact.

25 Comments:

Post a Comment

<< Home