Changes between Version 3 and Version 4 of ServerDebug


Ignore:
Timestamp:
Jul 6, 2007, 10:39:51 AM (17 years ago)
Author:
Nicolas
Comment:

Some formatting changes; added link to HtmlOps and external links to MySQL tools; replaced MySQLadmin with phpMyAdmin

Legend:

Unmodified
Added
Removed
Modified
  • ServerDebug

    v3 v4  
    33A grab-bag of techniques for debugging BOINC server software:
    44
    5 
    65== Log files ==
    76
    8 Most error conditions are reported in the log files. Make sure you know where these are. If you're interested in the history of a particular WU or result, grep for WU!#12345 or RESULT!#12345 (12345 represents the ID) in the log files. The html/ops pages also provide an interface for this.
     7Most error conditions are reported in the log files. Make sure you know where these are. If you're interested in the history of a particular WU or result, grep for `WU#12345` or `RESULT#12345` (where 12345 represents the ID) in the log files. The [HtmlOps html/ops pages] also provide an interface for this.
    98
    109== Debugging the scheduler ==
     
    1211The scheduler is a CGI program;
    1312it reads a request from stdin and writes a reply to stdout.
    14 You can run it with a command-line debugger like gdb:
     13You can run it with a command-line debugger like `gdb`:
    1514 * Copy the "scheduler_request_X.xml" file from a client to the machine running the scheduler. (X = your project URL)
    16  * Run the scheduler under the debugger, giving it this file as stdin,    i.e.:
     15 * Run the scheduler under the debugger, giving it this file as stdin, i.e.:
    1716{{{
    1817gdb cgi
     
    2019r < scheduler_request_X.xml
    2120}}}
    22  * You may have to doctor the database as follows:
     21 * You may have to doctor the database as follows to keep the scheduler from rejecting the request:
    2322{{{
    2423update host set rpc_seqno=0, rpc_time=0 where hostid=N
    2524}}}
    26 to keep the scheduler from rejecting the request.
    2725
    28 This is useful for figuring out why your project is generating 'no work available' messages.  As an alternative to this, edit handle_request.C, and put a call to debug_sched(sreq, sreply, "../debug_sched") just before sreply.write(fout). Then, after recompiling, touch a file called 'debug_sched' in the project root directory. This will cause transcripts of all subsequent scheduler requests and replies to be written to the cgi-bin/ directory with separate small files for each request.  The file names are sched_request_H_R where H=hostid and R=rpc sequence number. This can be turned off by deleting the 'debug_sched' file.
     26This is useful for figuring out why your project is generating 'no work available' messages.  As an alternative to this, edit `handle_request.C`, and put a call to `debug_sched(sreq, sreply, "../debug_sched")` just before `sreply.write(fout)`. Then, after recompiling, touch a file called 'debug_sched' in the project root directory. This will cause transcripts of all subsequent scheduler requests and replies to be written to the `cgi-bin/` directory with separate small files for each request.  The file names are `sched_request_H_R` where H=hostid and R=rpc sequence number. This can be turned off by deleting the 'debug_sched' file.
    2927
    30 To get core files for scheduler crashes, put
     28To get core files for scheduler crashes, put the following line in sched/main.C, and recompile:
    3129{{{
    3230#define DUMP_CORE_ON_SEGV 1
    3331}}}
    34 in sched/main.C, and recompile.
    3532
    3633== MySQL interfaces ==
    3734
    3835You should become familiar with MySQL tools such as
    39  * mytop: like 'top' for MySQL
    40  * the mysql interpreter ('mysql') and in particular the 'show processlist;' query.
    41  * MySQLadmin: general-purpose web interface to MySQL
     36 * The [http://dev.mysql.com/doc/refman/5.0/en/mysql.html mysql interpreter] and in particular the '[http://dev.mysql.com/doc/refman/5.0/en/show-processlist.html show processlist;]' query.
     37 * [http://jeremy.zawodny.com/mysql/mytop/ mytop]: like 'top' for MySQL
     38 * [http://www.phpmyadmin.net/ phpMyAdmin]: general-purpose web interface to MySQL
    4239
    4340== Database query tracing ==
    4441
    45 If you uncomment the symbol SHOW_QUERIES in db/db_base.C, and recompile everything, all database queries will be written to stderr (for daemons, this goes to log files; for command-line apps it's written to your terminal). This is verbose but extremely useful for tracking down database-level problems.
    46 
     42If you uncomment the symbol `SHOW_QUERIES` in db/db_base.C, and recompile everything, all database queries will be written to stderr (for daemons, this goes to log files; for command-line apps it's written to your terminal). This is verbose but extremely useful for tracking down database-level problems.