help-gnunet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gnunet] downloads and CPU (was: OK to use a FQDN for 'IP' in g


From: Brent Miller
Subject: Re: [Help-gnunet] downloads and CPU (was: OK to use a FQDN for 'IP' in gnunet.conf?)
Date: Sun, 13 Feb 2005 12:09:33 -0800
User-agent: Debian Thunderbird 1.0 (X11/20050116)

Christian Grothoff wrote:

You could compile gnunet-gtk with profilings support (-pg) and look at the gprof output to find out where the cycles are spent.
This is about 20 minutes worth of downloading:
___________________________________________________________

$ gprof /usr/local/bin/gnunet-gtk Flat profile:
Each sample counts as 0.01 seconds.
 %   cumulative   self              self     total
time   seconds   seconds    calls  Ts/call  Ts/call  name
80.00      0.04     0.04                             displayStats
20.00      0.05     0.01                             alphaComp
 0.00      0.05     0.00    17256     0.00     0.00  data_start
 0.00      0.05     0.00      869     0.00     0.00  gtkSaveCall
 0.00      0.05     0.00      866     0.00     0.00  gtkSaveCallDone
 0.00      0.05     0.00       64     0.00     0.00  refreshMenuSensitivity
 0.00      0.05     0.00       45     0.00     0.00  checkDaemonRunning
 0.00      0.05     0.00        1     0.00     0.00  addToNotebook
 0.00      0.05     0.00        1     0.00     0.00  checkForDaemon
 0.00      0.05     0.00        1     0.00     0.00  doAddToNotebook
 0.00      0.05     0.00        1     0.00     0.00  doInfoMessage
 0.00      0.05     0.00        1     0.00     0.00  doInitSearchResultList
0.00 0.05 0.00 1 0.00 0.00 doRefreshMenuSensitivity
 0.00      0.05     0.00        1     0.00     0.00  doneGTKStatistics
 0.00      0.05     0.00        1     0.00     0.00  getSearchWindow
 0.00      0.05     0.00        1     0.00     0.00  gtkDoneSaveCalls
 0.00      0.05     0.00        1     0.00     0.00  gtkInitSaveCalls
 0.00      0.05     0.00        1     0.00     0.00  gtkRunSomeSaveCalls
 0.00      0.05     0.00        1     0.00     0.00  infoMessage
 0.00      0.05     0.00        1     0.00     0.00  initGTKStatistics
 0.00      0.05     0.00        1     0.00     0.00  makeMainWindow
 0.00      0.05     0.00        1     0.00     0.00  openSaveAs
 0.00      0.05     0.00        1     0.00     0.00  startDownload

%         the percentage of the total running time of the
time       program used by this function.

cumulative a running sum of the number of seconds accounted
seconds   for by this function and those listed above it.

self      the number of seconds accounted for by this
seconds    function alone.  This is the major sort for this
          listing.

calls      the number of times this function was invoked, if
          this function is profiled, else blank.

self      the average number of milliseconds spent in this
ms/call    function per call, if this function is profiled,
          else blank.

total     the average number of milliseconds spent in this
ms/call    function and its descendents per call, if this
          function is profiled, else blank.

name       the name of the function.  This is the minor sort
          for this listing. The index shows the location of
          the function in the gprof listing. If the index is
          in parenthesis it shows where it would appear in
          the gprof listing if it were to be printed.


                    Call graph (explanation follows)


granularity: each sample hit covers 2 byte(s) for 20.00% of 0.05 seconds

index % time    self  children    called     name
                                                <spontaneous>
[1]     80.0    0.04    0.00                 displayStats [1]
               0.00    0.00     735/866         gtkSaveCallDone [5]
-----------------------------------------------
                                                <spontaneous>
[2]     20.0    0.01    0.00                 alphaComp [2]
-----------------------------------------------
               0.00    0.00       1/17256       parseOptions [177]
               0.00    0.00       1/17256       downloadGTK [94]
               0.00    0.00       1/17256       initGTKStatistics [20]
               0.00    0.00       2/17256       search [186]
               0.00    0.00       2/17256       gtkInitSaveCalls [17]
               0.00    0.00       2/17256       doneGTKStatistics [14]
               0.00    0.00       3/17256       gtkRunSomeSaveCalls [18]
               0.00    0.00       3/17256       doUpdateMenus [91]
               0.00    0.00       4/17256       gtkDoneSaveCalls [16]
               0.00    0.00       5/17256       destroyMain [70]
               0.00    0.00       5/17256       getSearchWindow [15]
               0.00    0.00       5/17256       receiveResults_ [182]
               0.00    0.00       5/17256       stopSearch_ [218]
               0.00    0.00       5/17256       abortSelectedDownloads [27]
               0.00    0.00       7/17256       stopSearch [217]
               0.00    0.00      10/17256       downloadFile_ [93]
               0.00    0.00      12/17256       openSaveAs [22]
               0.00    0.00      13/17256       main [167]
               0.00    0.00      14/17256       startDownload [23]
               0.00    0.00      63/17256       freeSearchList [105]
               0.00    0.00     180/17256       checkDaemonRunning [7]
0.00 0.00 390/17256 doRefreshMenuSensitivity [13]
               0.00    0.00     768/17256       displayResultGTK [83]
               0.00    0.00     864/17256       gtkSaveCallDone [5]
               0.00    0.00    6229/17256       modelCallback [168]
               0.00    0.00    8662/17256       gtkSaveCall [4]
[3]      0.0    0.00    0.00   17256         data_start [3]
-----------------------------------------------
               0.00    0.00       1/869         makeMainWindow [21]
               0.00    0.00       1/869         getSearchWindow [15]
               0.00    0.00       1/869         downloadFile_ [93]
               0.00    0.00       1/869         infoMessage [19]
               0.00    0.00       1/869         addToNotebook [8]
               0.00    0.00       1/869         cronCheckDaemon [61]
               0.00    0.00      64/869         refreshMenuSensitivity [6]
               0.00    0.00      64/869         displayResultGTK [83]
               0.00    0.00     735/869         modelCallback [168]
[4]      0.0    0.00    0.00     869         gtkSaveCall [4]
               0.00    0.00    8662/17256       data_start [3]
               0.00    0.00       1/1           doInfoMessage [11]
               0.00    0.00       1/1           doAddToNotebook [10]
               0.00    0.00       1/1           doInitSearchResultList [12]
0.00 0.00 1/1 doRefreshMenuSensitivity [13]
-----------------------------------------------
               0.00    0.00       1/866         doInitSearchResultList [12]
               0.00    0.00       1/866         disentangleFromCLIST [81]
               0.00    0.00      64/866         doDisplayResult [89]
0.00 0.00 65/866 doRefreshMenuSensitivity [13]
               0.00    0.00     735/866         displayStats [1]
[5]      0.0    0.00    0.00     866         gtkSaveCallDone [5]
               0.00    0.00     864/17256       data_start [3]
-----------------------------------------------
               0.00    0.00      64/64          displayResultGTK [83]
[6]      0.0    0.00    0.00      64         refreshMenuSensitivity [6]
               0.00    0.00      64/869         gtkSaveCall [4]
-----------------------------------------------
               0.00    0.00       1/45          checkForDaemon [9]
               0.00    0.00      44/45          cronCheckDaemon [61]
[7]      0.0    0.00    0.00      45         checkDaemonRunning [7]
               0.00    0.00     180/17256       data_start [3]
-----------------------------------------------
               0.00    0.00       1/1           search [186]
[8]      0.0    0.00    0.00       1         addToNotebook [8]
               0.00    0.00       1/869         gtkSaveCall [4]
-----------------------------------------------
               0.00    0.00       1/1           main [167]
[9]      0.0    0.00    0.00       1         checkForDaemon [9]
               0.00    0.00       1/45          checkDaemonRunning [7]
-----------------------------------------------
               0.00    0.00       1/1           gtkSaveCall [4]
[10]     0.0    0.00    0.00       1         doAddToNotebook [10]
-----------------------------------------------
               0.00    0.00       1/1           gtkSaveCall [4]
[11]     0.0    0.00    0.00       1         doInfoMessage [11]
-----------------------------------------------
               0.00    0.00       1/1           gtkSaveCall [4]
[12]     0.0    0.00    0.00       1         doInitSearchResultList [12]
               0.00    0.00       1/866         gtkSaveCallDone [5]
-----------------------------------------------
               0.00    0.00       1/1           gtkSaveCall [4]
[13]     0.0    0.00    0.00       1         doRefreshMenuSensitivity [13]
               0.00    0.00     390/17256       data_start [3]
               0.00    0.00      65/866         gtkSaveCallDone [5]
-----------------------------------------------
               0.00    0.00       1/1           main [167]
[14]     0.0    0.00    0.00       1         doneGTKStatistics [14]
               0.00    0.00       2/17256       data_start [3]
-----------------------------------------------
               0.00    0.00       1/1           search [186]
[15]     0.0    0.00    0.00       1         getSearchWindow [15]
               0.00    0.00       5/17256       data_start [3]
               0.00    0.00       1/869         gtkSaveCall [4]
-----------------------------------------------
               0.00    0.00       1/1           main [167]
[16]     0.0    0.00    0.00       1         gtkDoneSaveCalls [16]
               0.00    0.00       4/17256       data_start [3]
-----------------------------------------------
               0.00    0.00       1/1           main [167]
[17]     0.0    0.00    0.00       1         gtkInitSaveCalls [17]
               0.00    0.00       2/17256       data_start [3]
-----------------------------------------------
               0.00    0.00       1/1           stopSearch [217]
[18]     0.0    0.00    0.00       1         gtkRunSomeSaveCalls [18]
               0.00    0.00       3/17256       data_start [3]
-----------------------------------------------
               0.00    0.00       1/1           startDownload [23]
[19]     0.0    0.00    0.00       1         infoMessage [19]
               0.00    0.00       1/869         gtkSaveCall [4]
-----------------------------------------------
               0.00    0.00       1/1           main [167]
[20]     0.0    0.00    0.00       1         initGTKStatistics [20]
               0.00    0.00       1/17256       data_start [3]
-----------------------------------------------
               0.00    0.00       1/1           main [167]
[21]     0.0    0.00    0.00       1         makeMainWindow [21]
               0.00    0.00       1/869         gtkSaveCall [4]
-----------------------------------------------
               0.00    0.00       1/1           downloadGTK [94]
[22]     0.0    0.00    0.00       1         openSaveAs [22]
               0.00    0.00      12/17256       data_start [3]
               0.00    0.00       1/1           startDownload [23]
-----------------------------------------------
               0.00    0.00       1/1           openSaveAs [22]
[23]     0.0    0.00    0.00       1         startDownload [23]
               0.00    0.00      14/17256       data_start [3]
               0.00    0.00       1/1           infoMessage [19]
-----------------------------------------------

This table describes the call tree of the program, and was sorted by
the total amount of time spent in each function and its children.

Each entry in this table consists of several lines.  The line with the
index number at the left hand margin lists the current function.
The lines above it list the functions that called this function,
and the lines below it list the functions this one called.
This line lists:
    index      A unique number given to each element of the table.
               Index numbers are sorted numerically.
               The index number is printed next to every function name so
               it is easier to look up where the function in the table.

    % time     This is the percentage of the `total' time that was spent
               in this function and its children.  Note that due to
               different viewpoints, functions excluded by options, etc,
               these numbers will NOT add up to 100%.

    self       This is the total amount of time spent in this function.

    children   This is the total amount of time propagated into this
               function by its children.

    called     This is the number of times the function was called.
               If the function called itself recursively, the number
               only includes non-recursive calls, and is followed by
               a `+' and the number of recursive calls.

    name       The name of the current function.  The index number is
               printed after it.  If the function is a member of a
               cycle, the cycle number is printed between the
               function's name and the index number.


For the function's parents, the fields have the following meanings:

    self       This is the amount of time that was propagated directly
               from the function into this parent.

    children   This is the amount of time that was propagated from
               the function's children into this parent.

    called     This is the number of times this parent called the
               function `/' the total number of times the function
               was called.  Recursive calls to the function are not
               included in the number after the `/'.

    name       This is the name of the parent.  The parent's index
               number is printed after it.  If the parent is a
               member of a cycle, the cycle number is printed between
               the name and the index number.

If the parents of the function cannot be determined, the word
`<spontaneous>' is printed in the `name' field, and all the other
fields are blank.

For the function's children, the fields have the following meanings:

    self       This is the amount of time that was propagated directly
               from the child into the function.

    children   This is the amount of time that was propagated from the
               child's children to the function.

    called     This is the number of times the function called
               this child `/' the total number of times the child
               was called.  Recursive calls by the child are not
               listed in the number after the `/'.

    name       This is the name of the child.  The child's index
               number is printed after it.  If the child is a
               member of a cycle, the cycle number is printed
               between the name and the index number.

If there are any cycles (circles) in the call graph, there is an
entry for the cycle-as-a-whole.  This entry shows who called the
cycle (as parents) and the members of the cycle (as children.)
The `+' recursive calls entry shows the number of function calls that
were internal to the cycle, and the calls entry for each member shows,
for that member, how many times it was called from other members of
the cycle.



Index by function name

[8] addToNotebook [12] doInitSearchResultList (search.c) [5] gtkSaveCallDone
  [2] alphaComp              [13] doRefreshMenuSensitivity [19] infoMessage
[7] checkDaemonRunning (helper.c) [14] doneGTKStatistics [20] initGTKStatistics [9] checkForDaemon [15] getSearchWindow [21] makeMainWindow (main.c)
  [3] data_start             [16] gtkDoneSaveCalls       [22] openSaveAs
[1] displayStats (download.c) [17] gtkInitSaveCalls [6] refreshMenuSensitivity
 [10] doAddToNotebook        [18] gtkRunSomeSaveCalls    [23] startDownload
 [11] doInfoMessage           [4] gtkSaveCall

___________________________________________________________

Ironically, gnunet-download *seems* to use up more cpu than gnunet-gtk, but I'll have to download an entire file to get a profile as I don't get a gmon.out if I hit ctrl-c or send a kill sig to it.

Also, here's the system info:

OS             : Linux
OS RELEASE     : 2.6.10-1-k7
HARDWARE       : i686
OpenSSL        : 0.9.7e 25 Oct 2004
gcc            : gcc (GCC) 3.3.5 (Debian 1:3.3.5-8)
make           : 3.80
awk: cmd. line:1:       if (length($4) = 0) {\
awk: cmd. line:1:                      ^ syntax error
awk: cmd. line:3:       } else {\
awk: cmd. line:3:         ^ syntax error
automake       : 1.6.3
libtool        : 1.5.6
libextractor   : v0.3.11
GNUnet         : 0.6.6a
libgcrypt      : 1.2.0
mysql          : Not Found
db_stat: invalid option -- V
usage: db_stat [-clmNt] [-C Acflmo] [-d file] [-h home] [-M Ahlm]
glib1          : 1.2.10
glib2          : 2.6.2
gtk+           : 1.2.10
gtk2+          : 2.6.2
GMP            : libgmp3-dev-4.1.4-5.deb
GNU gettext    : 0.14.1

____________________________________________________________

Alternatively, I'd suggest to just 'nice' the process, that should keep the rest of your system responsive. You can also try to make sure that you compile the code with -O2 (may help a bit).
I generally compile with CFLAGS="-O3 -march=athlon-xp -g" although I've tried it with just -O2 and -O0 to see if it would make a difference, which it didn't.

I wonder if anyone else is having a problem with high CPU utilization by the _clients_ (not gnunetd)?
I've indexed a copy of Knoppix if anybody else wants to try a large file:
gnunet-download -o "KNOPPIX_V3.7-2004-12-08-EN.iso" gnunet://afs/2LSAHRM7VOHV61KOFS4TPR0SRN0Q7N24.FINOUGUMG6ACCU1HVCPKT4PCEOA2EDHR.E3A5CC03.732942336


Thanks,
Brent




reply via email to

[Prev in Thread] Current Thread [Next in Thread]