Whats is GUDS?
The GUDS script is a ksh script designed to collect the data needed to analyze performance issues. The script collects a specific set of files and runs a series of operating system utilities, the selection of which are based on the specified level. The duration, number of iterations, and other variables are provided to the script either as a set of command line arguments or are prompted for input in interactive mode. The collected data is then packaged and compressed in a standard format for delivery to Oracle support.
GUDS is an acronym for “Grand Unified Deprivation Script“.
Requirements
At a minimum, the script should be run during the time the performance issue is present. Typically the script’s defaults are recommended. For the best analysis, you should run this script twice.
- Run the script when the system is experiencing the performance problem.
- Run it again when the machine is doing well.
This will allow the engineer working on the call to compare bad data to baseline data. Some numbers are meaningless without baseline data. Be sure to add a meaningful description to the guds collection when asked. This will assist the support engineer in associating the collected data with the reported state of the system.
Configuration
The script should always be run as the UID of root and in the global zone, if zones are present. The script requires a Service Request number which is used to create a directory for the output of the script, which will be /var/tmp/guds/[SR#]. The script also requires a one-line description of the state of the machine during the collection. This description will be added to the INFO file.
The output directory will be created in the following format.
guds.[Host ID].[Host Name]-YYYY.MM.HH.MM.SS
The packaged file for delivery to Oracle support will be created in the following format.
SR#_guds.[Host ID].[Host Name]-YYYY.MM.HH.MM.SS.EXT
Where,
“SR#” is the Service Request number that was input.
“EXT” is one of “.zip”, “.tgz”, or “.uu”.
Please make sure that the file you send to Oracle is the packaged file, i.e., the file that ends in the suffix “.zip”, “.tgz”, or “.uu”.
Example
The defaults are:
Hours: 0 Count: 40 Interval: 5 Iterations: 5 Wait: 0 Extended: 2 Collect mpstat -a data? no Collect ipstat and tcpstat data if able? no // This prompt only shows up for S11.1 and up Collect prstat cpu, rss, size and zones data: no Collect trapstat data? no Collect configuration data: yes Collect configuration data before performance data: no Collect VM2.0 data? yes
Therefore, by default, those commands to which the constraints above apply, will run 5 times, each time collecting 40 samples at 5 second intervals. The command line equivalent of the defaults would be:
# ./guds -q -d "One line description of system state during capture" -s[case#]
Below is the syntax and parameter definitions for use in non-interactive mode output from the script when the -h (help) option is provided.
# ./guds -h Usage: guds [-aCeghIMNOpPqrRStTvVZ] [-b cpuid] [-c count] [-d description] [-D dir] [-H hours] [-i interval] [-L lockstat_interval] [-n iterations] [-s SR#] [-w wait] [-x "extra command"] [-X level] -a : Collect mpstat-a.out -b : Bind guds to the processor cpuid -c : Count value for commands that require it (default: 40) (vmstat, prstat, iostat, mpstat, sar, ...) -C : Collect configuration data before performance data -d : A one line statement describing the state of the system during this capture -D : Change the default directory from /var/tmp/guds to-e : Inhibit collecting network data -g : Skip collecting static configuration data -h : Display this help text -H : Run the script for the given number of hours, else for the given number of iterations if hours is zero -i : Interval value for commands that require it (default: 5) (vmstat, prstat, iostat, mpstat, sar, ...) -I : Inhibit collecting iostat* data -L : Specify the interval during which lockstat is gathering data (default: 2 seconds) -M : Allow GUDS to run in a guest LDOM -n : The number of iterations the script will do to collect data (default: 5) -N : If specified, collect ipstat and tcpstat data if able -O : Override check for another GUDS running and allow execution -p : If specified, on SPARC, and level >= 2, collect trapstat data -P : Overide guds exit on perl binary error -q : Run in non interactive mode -r : Collect prstat cpu,rss,size, and zones data if able -R : Allow script to run when uid is not root -s : The SR # used to create the directory where the data are going to be stored -S : If specified, mask all IP addresses in the data -t : Inhibit collecting dlstat data -T : Emit timestamps for commands that loop (vmstat, mpstat, prstat, iostat, ipstat, tcpstat) -v : Print the GUDS Version -V : Do not collect VM2.0 data -w : Wait time between each iteration (default: 0 seconds) If set to 0, then the next iteration will start when the previous finishes -x : Run this extra command during each iteration Output saved in xtra.out - Errors saved in xtra.err -X : Run the extended set of commands depending on specified level level 0 : nothing level 1 : lockstat for contention events level 2 : trapstat (if -p), lockstat profiling, threadlist, TNF tracing (default) level 3 : kmastat, kmausers, memstat (they can take a long time to complete on systems with a lot of memory) Increasing extended level can affect system performance. -Z : Allow script to run in a non-global zone
Run GUDS as user root in the global zone.
More Examples:
1. Run GUDS with the default values. The d and s options are required.
# ./guds -q -s3-12345678 -d "Issue Present"
2. Run GUDS for 2 hours with 20 samples at 10 second intervals for each collection.
# ./guds -q -c20 -i10 -H2 -s3-12345678 -d 'High system time period'
The Script
Here is the latest version of the script. This file has been compressed using zip. Once you have downloaded the file you will need to uncompress it using the unzip command and change the permissions so that it is executable.
# unzip guds_3_11.zip # chmod u+x guds
You may verify the integrity of the unzipped guds file by comparing the md5 digest above with the output of the following command.
# digest -a md5 guds
Sample Output
When running the script in interactive mode you will see the following:
Performance Script ------------------ This script will run on your system for an amount of time determined by the number of iterations the script is asked to do, and the count and interval supplied for various commands. If you have not been given specific values, please accept the defaults when asked. This will cause the script to run for about 20 minutes. For the best analysis, you should run this script twice. 1) Run the script when the system is experiencing the performance problem. 2) Run it again when the machine is doing well. This will allow the kernel engineer working on the call to compare bad data to baseline data. Some numbers are meaningless without baseline data. This script will gather data from your system and put it in a directory called /var/tmp/guds[SR#]. Please enter your Service Request number. The SR number should only consist of digits or of the pattern [0-9]-[0-9]+. SR #: (Insert SR number here) Enter the number of hours for the script to run. If the number of hours given is zero, the script will run for the specified number of iterations. For a positive, non zero number of hours, the script will run using the specified count, interval and wait parameters until the given number of hours has been met or exceeded. Hours[0]: Please enter the count option for commands that require it. These are commands like vmstat and iostat which use an interval and a count to repeat the output. For example, using a count of 10 and interval of 30 will cause iostat, vmstat, mpstat, etc to output 10 sets of data, with 30 seconds between data sets. If you have not been given a value for this number, the default value will be 40 Count[40]: Please enter the interval option for commands that require it. These are commands like vmstat and iostat which use an interval and count to repeat the output. If you have not been given a value for this number, the default value will be 5 Interval[5]: Please enter the number of total data sets for the script to capture. Each data set contains the output of one SET of a commands output. For example, a single data set would contain an entire "ps -elf" output, and an entire vmstat output, where the vmstat output is made up of a variable number of data lines, as defined by "count" and "interval" If you have not been given instructions for this number, the default value will be 5 Iterations[5]: Please enter the number of seconds to wait between collecting data sets. To ensure correct data collection, any value entered will be added to the minimum wait time. If you have not been given instructions for this number, the default value will be 0 Wait[0]: Select extended commands level. If you have not been given instructions for this number, the default value will be 2 level 0 : nothing level 1 : lockstat for contention events level 2 : L1 + lockstat profiling, threadlist, TNF tracing (default) level 3 : L2 + kmastat, kmausers, memstat Enter the level : '0', '1', '2' or '3'. Extended[2]: Collect mpstat -a data? [n]: Collect ipstat and tcpstat data if able? [n]: Collect prstat cpu, rss, size and zones data? [n]: Collect trapstat data? [n]: Collect configuration data? [y]: Collect configuration data before performance data? [n]: Collect VM2.0 data? [y]: Please enter a one line statement describing the current capture environment. Some examples are "Performance issue is present" or "System is operating normally". This statement will be added to the INFO file so the support engineer knows the state of the system associated with this data. Description: High system time period Enter the location of the output directory [/var/tmp/guds]: Starting Data Gathering Collecting performance data... Begin Iteration #1 50/50 End Iteration #1 Waiting for processes to terminate, then sleeping 0 seconds before the next iteration. --- All processes finished. --- Begin Iteration #2 50/50 End Iteration #2 Waiting for processes to terminate, then sleeping 0 seconds before the next iteration. --- All processes finished. --- Begin Iteration #3 50/50 End Iteration #3 Waiting for processes to terminate, then sleeping 0 seconds before the next iteration. --- All processes finished. --- Begin Iteration #4 50/50 End Iteration #4 Waiting for processes to terminate, then sleeping 0 seconds before the next iteration. --- All processes finished. --- Begin Iteration #5 43/43 End Iteration #5 Waiting for processes to terminate, then sleeping 0 seconds before the next iteration. --- All processes finished. --- Collecting System Information 31/31 Creating zip file... Please send the data to your support engineer. The data are stored in /var/tmp/guds/3-12548564/3-12548564_guds.83f2f185.test-2011.01.20.17.44.zip