gpmemwatcher
Tracks the memory usage of each process in a Greengage DB cluster.
Synopsis
gpmemwatcher [ -f <hostfile> | --host_file=<hostfile> ]
[ -d <work_dir> | --work_dir=<work_dir> ]
[ -r <results_dir> | --results_dir=<results_dir> ]
[ --daemon ]
gpmemwatcher --stop
[ -f <hostfile> | --host_file=<hostfile> ]
[ -d <work_dir> | --work_dir=<work_dir> ]
[ -r <results_dir> | --results_dir=<results_dir> ]
gpmemwatcher --version
gpmemwatcher -h | --help
Description
The gpmemwatcher utility is a daemon that runs on all servers of a Greengage DB 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 Greengage DB 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 Greengage DB cluster with gpmemwatcher and then use gpmemreport to analyze the files collected.
Options
- -f | --host_file <hostfile>
-
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:
mdw:/home/gpadmin/gpmemwatcher_dir/working sdw1:/home/gpadmin/gpmemwatcher_dir/working sdw2:/home/gpadmin/gpmemwatcher_dir/working sdw3:/home/gpadmin/gpmemwatcher_dir/working sdw4:/home/gpadmin/gpmemwatcher_dir/working - -d | --work_dir <work_dir>
-
Specify the working directory used by
gpmemwatcher. - -r | --results_dir <results_dir>
-
Specify the directory where
gpmemwatcherwrites the collected output files (for example, the .gz files generated when you stop the utility). - --daemon
-
Run
gpmemwatcheras a background process. - --stop
-
Stop all the
gpmemwatcherprocesses, generates .gz data files in the current directory, and removes all the work files from all the hosts. - --version
-
Display the version of this utility.
- -h | --help
-
Display 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:
mdw:/home/gpadmin/gpmemwatcher_dir/working
sdw1:/home/gpadmin/gpmemwatcher_dir/working
sdw2:/home/gpadmin/gpmemwatcher_dir/working
sdw3:/home/gpadmin/gpmemwatcher_dir/working
sdw4:/home/gpadmin/gpmemwatcher_dir/working
Make sure that the path /home/gpadmin/gpmemwatcher_dir/working exists on all hosts.
Start the utility:
$ gpmemwatcher -f /home/gpadmin/hostmap.txt
Example 2
Stop the utility and dump the results into a .gz file. Stop the utility you started in Example 1:
$ gpmemwatcher -f /home/gpadmin/hostmap.txt --stop
The resulting .gz files will be dumped into the directory where you are running the command:
$ ls -thrl
The result:
-rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 mdw.ps.out.gz -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 sdw1.ps.out.gz -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 sdw2.ps.out.gz -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 sdw3.ps.out.gz -rw-rw-r--. 1 gpadmin gpadmin 2.8K Nov 19 15:17 sdw4.ps.out.gz