rmss Command

Purpose

Simulates a system with various sizes of memory for performance testing of applications.

Syntax

rmss -c MemSize

rmss -r

rmss -p

rmss [ -d MemSize ] [ -f MemSize ] [ -n NumIterations ] [ -o OutputFile ] [ -s MemSize ] Command

Description

The rmss command simulates a system with various sizes of real memory, without having to extract and replace memory boards. By running an application at several memory sizes and collecting performance statistics, you can determine the memory needed to run an application with acceptable performance. The rmss command can be invoked for either of two purposes:

Attention: When rmss is used on a multiple memory pool system, it may fail with:
Failure: VMM unable to free enough frames for stealing.
Choose a larger memory size or retry with less system activity.

Or a similar message. This failure can occur when rmss has stolen all the frames from a memory pool, and is unable to steal frames from other pools. A workaround is to decrease memory by increments.

The number and size of memory pools on a system can be retrieved with the command:

echo "mempool *" | kdb

The -c, -p, and -r flags are mutually exclusive. The -c flag changes the memory size; the -p flag displays the current memory size; and the -r flag resets the memory size to the real memory size of the machine.

The -s, -f, -d, -n, and -o flags are used in combination when the rmss command is invoked as a driver program to execute and measure the performance of a command (where a command is an executable or a shell script file) over a range of memory sizes. When invoked this way, the rmss command displays performance statistics, such as the response time of the command and the number of page-ins that occurred while the command ran, for each memory size. These statistics, which are also written to a file, are described in this example.

The -s and -f flags specify the starting and ending points of the range, while the -d flag specifies the increment or decrement between memory sizes within the range. The -n flag is used to specify the number of times to run the command at each memory size, and the -o flag is used to specify the name of an output file into which to write the rmss report. The Command parameter specifies the command to be run and measured at each memory size.

Note:
  1. The rmss command reports “usable” real memory. On machines where there is bad memory or where the system is using the memory, rmss reports the amount of real memory as the amount of physical real memory minus the memory that is bad or in use by the system. For example, using the rmss -r flag might report:
    Simulated Memory Size changed to 79.9062MB
    This could be a result of some pages being marked bad or a result of a device that is reserving some pages for its own use (and thus not available to the user).
  2. The rmss command may underestimate the number of page-ins that are required to run an application if the application, combined with background processes such as daemons, accesses a lot of different files (including directory files). The number of different files that must be accessed to cause such results is approximately 250 files per 8MB of simulated memory size. The following table gives the approximate number of different files that, when accessed at the given simulated memory size, may result in the rmss command underestimating page-in requirements.
    Simulated Memory Size (MB) Access to Different Files
    8 250
    16 500
    24 750
    32 1000
    48 1500
    64 2000
    128 4000
    256 8000

You can use the filemon command to determine the number of files accessed while your command runs, if you suspect that it may be accessing many different files.

Flags

Item Description
-c MemSize Changes the simulated memory size to the MemSize value, which is an integer or decimal fraction in units of megabytes. The MemSize variable must be between 8MB and the real memory size of the machine. There is no default for the -c flag.
Note: It is difficult to change the simulated memory size to less than 8MB, because of the size of inherent system structures such as the kernel.
-d MemSize Specifies the increment or decrement between memory sizes to be simulated. The MemSize value is an integer or decimal fraction in units of megabytes. If the -d flag is omitted, the increment or decrement will be 8MB.
-f MemSize Specifies the final memory size. You should finish testing the simulated system by executing the command being tested at a simulated memory size given by the MemSize variable, which is an integer or decimal fraction in units of megabytes. The MemSize variable must be between 4MB and the real memory size of the machine. If the -f flag is omitted, the final memory size will be 8MB.
Note: It is difficult to finish at a simulated memory size of less than 8MB because of the size of inherent system structures such as the kernel.
-n NumIterations Specifies the number of times to run and measure the command, at each memory size. There is no default for the -n flag. If the -n flag is omitted, during rmss command initialization, the rmss command will determine how many iterations of the command being tested are necessary to accumulate a total run time of 10 seconds, and then run the command that many times at each memory size.
Note: The rmss command always executes the command once at each memory size prior to the executions that are measured. This prepares the simulation for the actual test.
-o OutputFile Specifies the file into which to write the rmss report. If the -o flag is omitted, then the rmss report is written to the file rmss.out. In addition, the rmss report is always written to standard output.
-p Displays the current simulated memory size.
-r Resets the simulated memory size to the real memory size of the machine.
-s MemSize Specifies the starting memory size. Start by executing the command at a simulated memory size specified by the MemSize variable, which is an integer or decimal fraction in units of megabytes. The MemSize variable must be between 4MB and the real memory size of the machine. If the -s flag is omitted, the starting memory size will be the real memory size of the machine.
Note: It is difficult to start at a simulated memory size of less than 8MB, because of the size of inherent system structures such as the kernel.
Command Specifies the command to be run and measured at each memory size. The Command parameter may be an executable or shell script file, with or without command line arguments. There is no default command.

Exit Status

This command returns the following exit values:

Item Description
0 Successful completion.
>0 An error occurred.

Security

Access Control: You must have root authority to run this command.

Attention RBAC users and Trusted AIX® users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To change the memory size to 13.5MB, enter:
    rmss -c 13.5
  2. To print the current memory size, enter:
    rmss -p
  3. To reset the memory size to the real memory size of the machine, enter:
    rmss -r
  4. To investigate the performance of the command cc -O foo.c on memory sizes 32, 24, 16, and 8MB; run and measure the command once at each memory size; and then write the report to the cc.rmss.out file, enter:
    rmss -s 32 -f 8 -d 8 -n 1 -o cc.rmss.out cc -O foo.c
  5. To investigate the performance of the sequence of commands in the foo.sh shell script file on memory sizes starting at the real memory size of the machine and ending at 8MB, by increments of 8MB; let the rmss command determine the number of iterations to run and measure the foo.sh at file each memory size; and then write the rmss report to the rmss.out file (with all defaults used in this invocation of the rmss command), enter the following:
    rmss foo.sh
  6. To investigate the performance of the executable bar on memory sizes from 8MB to 16MB, by increments of 0.5MB; run and measure bar twice at each memory size; and write the report to the bar.rmss.out file, enter:
    rmss -s 8 -f 16 -d .5 -n 2 -o bar.rmss.out bar
  7. When any combination of the -s, -f, -d, -n, and -o flags is used, the rmss command runs as a driver program, which executes a command multiple times over a range of memory sizes, and displays statistics describing the command's performance at each memory size.

    An example of the report printed out by the rmss command follows:

    Hostname:  xray.austin.ibm.com
    Real memory size:   48.00 Mb
    Time of day:  Wed Aug  8 13:07:33 1990
    Command:  cc -O foo.c
    Simulated memory size initialized to  24.00 Mb.
    Number of iterations per memory size = 1 warmup + 1 measured = 2.
    Memory size  Avg. Pageins  Avg. Response Time   Avg. Pagein Rate
    (megabytes)                       (sec.)           (pageins/sec.)
       -----------------------------------------------------------------
    24.00             0.0              113.7                0.0
    22.00             5.0              114.8                0.0
    20.00             0.0              113.7                0.0
    18.00             3.0              114.3                0.0
    16.00             0.0              114.6                0.0
    14.00             139.0            116.1                1.2
    12.00             816.0            126.9                6.4
    10.00             1246.0           135.7                9.2
    8.00              2218.0           162.9                13.6
    This report was generated by the following command:
    rmss -s 24 -f 8 -d 2 -n 1 cc -O foo.c
    The top part of the report gives general information, including the machine that the rmss command was running on, the real memory size of that machine, the time and date, and the command that was being measured. The next two lines give informational messages that describe the initialization of the rmss command. Here, the rmss command displays that it has initialized the simulated memory size to 24MB, which was the starting memory size given with the -s flag. Also, the rmss command prints out the number of iterations that the command will be run at each memory size. The command is to be run twice at each memory size: once to warmup, and once when its performance is measured. The number of iterations was specified by the -n flag.

    The lower part of the report provides the following for each memory size the command was run at:

    • The memory size, along with the average number of page-ins that occurred while the command was run
    • The average response time of the command
    • The average page-in rate that occurred when the command was run.
      Note: The average page-ins and average page-in rate values include all page-ins that occurred while the command was run, not just those initiated by the command.

Files

Item Description
/usr/bin/rmss Contains the rmss command.