## -_- $Name: PerfGraph-2_4d $ % $Id: MULTINST,v 1.9.10.1 2001/01/03 15:42:06 sietse Exp $

===========================================================================
How to run PerfGraph multiple times on 1 system
===========================================================================

You can run multiple PerfGraph's 2.1 and higher on one system concurrently.
Make sure you are familiar with PerfGraph before you start using this
feature!

Here is what you have to do to start a 2nd PerfGraph (called PG2).

 1. Create a new user and create a separate environment for PG2
    (copy the files of PG1 to a new directory), owned by the new user.

 2. Define an environment variable called PERFDB, and give it a name like
    'perfdb2'. Make sure the name is NOT 'perfdb' - this is used by the
    default instance of perfdb.

 3. Define an environment variable called PERFDIR, and give it the name
    of the new directory PG2 where the new instance must run from.

 4. On the web-server, copy perfgraph.html to a new file (e.g.
    'perfgraph-2.html'). Also, make a copy of perfgraph.cgi (e.g.
    'perfgraph-2.cgi').

 5. Edit perfgraph-2.html, and change references to 'perfgraph.cgi' to
    the new .cgi script (e.g. 'perfgraph-2.cgi').

 6. Edit the new perfgraph-2.cgi script, and change the port number to
    e.g. 29165.

 7. Edit perfgraphd, and change the variable $PG_CGI to the name
    reflecting the new .cgi script.

 8. If you run perfgraph from another user, then su to user postgres,
    and run the following command:
    ~/bin/createuser
    and answer with the username to add (e.g. perfgr2), accept id, yes, no

 9. You are ready to run perfconf, and then pgstart.
    Use the option -p <port> of pgstart to match the port number as in 6,
    or set an evironment variable $PERFGRAPHPORT with the value of
    the port number.

10. When calling perfclean from cron, make sure to set the PERFDB and 
    PERFDIR variables, e.g.:
    1 3 * * * PERFDB=perfdb2; PERFDIR=/home/perfgr2; \
              export PERFDB PERFDIR; /home/perfgr2/perfclean

11. When using perfsysstartup, make sure to set the environment variables
    before running pgstart.

12. On a AIX or HP-UX client, set the variable PERFDIR in the crontab:
    * * * * * PERFDIR=/home/perfgr2; export PERFDIR; \
              /home/perfgr2/perfgather.ksh

===========================================================================
Issues on running multiple instances of PerfGraph
===========================================================================

- You cannot monitor the same system twice with the same name.
  Workaround: Define an alias for the system in /etc/hosts, and use that
              alias in the PG2 environment.

- On the measured system, perfclientd and perfgather.ksh still need to run
  in the home directory of the new perfgraph user - not in a subdirectory.

- There is still a limit of 30 systems that can be measured. So if instance
  1 is measuring 10 systems, then instance 2 can measure max. 20 systems.
  Actually, if you setup more instances, the maximum number of systems
  being measured will be less than 30.

