Subject: Re: Strange behavior with build.sh -j 4
To: Julio Merino <jmmv@menta.net>
From: Andreas Gustafsson <gson@gson.org>
List: current-users
Date: 10/27/2002 15:26:14
Julio Merino writes:
> My i386 box is single-processor, but I wanted to try a build.sh with
> -j 4 to see if performance incremented a bit (like I used to do in
> FreeBSD). Everything went ok until a point where everything started
> to go extremely slow.
> 
> I checked this with the wmcpuload dock applet, which shows how much
> cpu is used in percentage. When the build reached "that" point (I have
> the log, can check it later), I saw the cpu most of the time at 0%,
> and it was going up for few moments... i.e.., it did 0% -> 30% (a
> second) -> 0%. And 0% delayed around 2 - 3 seconds. (replace 30% with
> any other value, as sometimes reached 100%). Just to say than before
> I noticed this behavior, uptime showed a load average around 10 and
> before that point, around 1 or 2...

I saw something similar the other day while running

  build.sh -j 2 -d -D /usr/native_destdir -R /usr/native_release -T /usr/native_tool

on a dual Athlon 1800.  About halfway though the build, it seemed to
be compiling only about one file every five seconds, and vmstat showed
the CPUs 99% idle.  At some later point in the build, the compile
picked up speed again.

I ran pstree -w while the build was exhibiting the slowdown, and it
showed the following processes (pardon the long line in the middle):

   \-+- 27115 root sh ./build.sh -j 2 -d -D /usr/native_destdir -R /usr/native_release -T /usr/native_tools 
     \-+- 27929 root /usr/native_tools/bin/nbmake -j 2 release 
       \-+= 27938 root sh -evq 
         \-+- 27939 root /usr/native_tools/bin/nbmake NOPOSTINSTALL 1 
           \-+- 09985 root /bin/sh -ec (cd /usr/src && /usr/native_tools/bin/nbmake do-build) 
             \-+- 09986 root /usr/native_tools/bin/nbmake do-build 
               \-+= 09987 root sh -evq 
                 \-+- 09988 root /usr/native_tools/bin/nbmake dependall BUILD_tools no 
                   \-+- 11393 root /bin/sh -ec targ=dependall;dir=rescue;\t\t case "$dir" in /*)\t\t\t\t\t\t echo "$targ ===> $dir";\t\t\t\t cd "$dir";\t\t\t\t\t\t /usr/native_tools/bin/nbmake "_THISDIR_=$dir/" $targ;\t\t\t ;;\t\t\t\t\t\t\t *)\t\t\t\t\t\t\t\t echo "$targ ===> $dir";\t\t\t cd "/usr/src/$dir";\t\t\t\t\t /usr/native_tools/bin/nbmake "_THISDIR_=$dir/" $targ;\t\t ;;\t\t\t\t\t\t\t esac 
                     \-+- 11394 root /usr/native_tools/bin/nbmake _THISDIR_ rescue/ 
                       \-+= 11419 root sh -evq 
                         \-+- 11420 root /usr/native_tools/bin/nbmake realall 
                           \-+= 12020 root sh -evq 
                             \-+- 12021 root /usr/native_tools/bin/nbmake -j 1 -f rescue.mk all 
                               \-+= 14976 root sh -evq 
                                 \-+- 14979 root /usr/native_tools/bin/nbmake CRUNCHEDPROG 1 DBG -Os -f- depend fsck.o 
                                   \--= 14998 root (sh)

I'm sure the machine was not thrashing as it has a gigabyte of RAM.
-- 
Andreas Gustafsson, gson@gson.org