Index: openacs-4/packages/acs-core-docs/www/maint-performance.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/maint-performance.html,v diff -u -r1.19 -r1.20 --- openacs-4/packages/acs-core-docs/www/maint-performance.html 5 Jul 2004 14:24:59 -0000 1.19 +++ openacs-4/packages/acs-core-docs/www/maint-performance.html 16 Feb 2005 00:21:03 -0000 1.20 @@ -1,7 +1,7 @@ -Diagnosing Performance Problems

Diagnosing Performance Problems

Creating an appropriate tuning and monitoring environment

+ order by s.username ,s.sid ,s.serial# ,sql.piece ;

To kill a troubled process:

alter system kill session 'SID,SERIAL#';  --substitute values for SID and SERIAL#

(See Andrew Piskorski's Oracle notes)

  • Identify a runaway Postgres query. First, logging must be enabled in the database. This imposes a performance penalty and should not be done in normal operation.

    Edit the file postgresql.conf - its location depends on the PostGreSQL installation - and change

    #stats_command_string = false

    to

    stats_command_string = true

    Next, connect to postgres (psql service0) and select * from pg_stat_activity;. Typical output should look like:

    +  datid   |   datname   | procpid | usesysid | usename |  current_query
    +----------+-------------+---------+----------+---------+-----------------
    + 64344418 | openacs.org |   14122 |      101 | nsadmin | <IDLE>
    + 64344418 | openacs.org |   14123 |      101 | nsadmin |
    +                                                         delete
    +                                                         from acs_mail_lite_queue
    +                                                         where message_id = '2478608';
    + 64344418 | openacs.org |   14124 |      101 | nsadmin | <IDLE>
    + 64344418 | openacs.org |   14137 |      101 | nsadmin | <IDLE>
    + 64344418 | openacs.org |   14139 |      101 | nsadmin | <IDLE>
    + 64344418 | openacs.org |   14309 |      101 | nsadmin | <IDLE>
    + 64344418 | openacs.org |   14311 |      101 | nsadmin | <IDLE>
    + 64344418 | openacs.org |   14549 |      101 | nsadmin | <IDLE>
    +(8 rows)
    +openacs.org=>
  • Creating an appropriate tuning and monitoring environment

    The first task is to create an appropriate environment for finding out what is going on inside Oracle. Oracle provides Statspack, a package to monitor and save the state of the v$ performance views. These reports @@ -43,7 +58,7 @@

    To be able to get a overview of how Oracle executes a particular query, install "autotrace". I usually follow the instructions here http://asktom.oracle.com/~tkyte/article1/autotrace.html. -

    Make sure, that the Oracle CBO works with adequate statistics

    +

    Make sure, that the Oracle CBO works with adequate statistics

    The Oracle Cost Based optimizer is a piece of software that tries to find the "optimal" execution plan for a given SQL statement. For that it estimates the costs of running a SQL query in a particular way (by default