gpmemwatcher

Tracks the memory usage of each process in a Greenplum Database cluster.

Synopsis

  1. gpmemwatcher [-f | --host_file <hostfile>]
  2. gpmemwatcher --stop [-f | --host_file <hostfile>]
  3. gpmemwatcher --version
  4. gpmemwatcher -h | --help

Description

The gpmemwatcher utility is a daemon that runs on all servers of a Greenplum Database cluster. It tracks the memory usage of each process by collecting the output of the ps command every 60 seconds. It is a low impact process that only consumes 4 MB of memory. It will generate approximately 30 MB of data over a 24-hour period.

You may use this utility if Greenplum Database is reporting Out of memory errors and causing segments to go down or queries to fail. You collect the memory usage information of one or multiple servers within the Greenplum Database cluster with gpmemwatcher and then use gpmemreport to analyze the files collected.

Options

-f | –host_file hostfile

Indicates the hostfile input file that lists the hosts from which the utility should collect memory usage information. The file must include the hostnames and a working directory that exists on each one of the hosts. For example:

  1. mdw:/home/gpadmin/gpmemwatcher_dir/working
  2. sdw1:/home/gpadmin/gpmemwatcher_dir/working
  3. sdw2:/home/gpadmin/gpmemwatcher_dir/working
  4. sdw3:/home/gpadmin/gpmemwatcher_dir/working
  5. sdw4:/home/gpadmin/gpmemwatcher_dir/working

–stop

Stops all the gpmemwatcher processes, generates .gz data files in the current directory, and removes all the work files from all the hosts.

–version

Displays the version of this utility.

-h | –help

Displays the online help.

Examples

Example 1: Start the utility specifying the list of hosts from which to collect the information

Create the file /home/gpadmin/hostmap.txt that contains the following:

  1. mdw:/home/gpadmin/gpmemwatcher_dir/working
  2. sdw1:/home/gpadmin/gpmemwatcher_dir/working
  3. sdw2:/home/gpadmin/gpmemwatcher_dir/working
  4. sdw3:/home/gpadmin/gpmemwatcher_dir/working
  5. sdw4:/home/gpadmin/gpmemwatcher_dir/working

Make sure that the path /home/gpadmin/gpmemwatcher_dir/working exists on all hosts.

Start the utility:

  1. $ gpmemwatcher -f /home/gpadmin/hostmap.txt

Example 2: Stop utility and dump the resulting into a .gz file

Stop the utility you started in Example 1:

  1. $ gpmemwatcher -f /home/gpadmin/hostmap.txt --stop

The results .gz files will be dumped into the directory where you are running the command:

  1. $ [gpadmin@gpdb-m]$ ls -thrl
  2. -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 mdw.ps.out.gz
  3. -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 sdw1.ps.out.gz
  4. -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 sdw2.ps.out.gz
  5. -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 sdw3.ps.out.gz
  6. -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 sdw4.ps.out.gz

See Also

gpmemreport