-c, -p, and -r flags of the rmss command

The advantage of using the -c, -p and -r flags of the rmss command is that they allow you to experiment with complex applications that cannot be expressed as a single executable program or shell script file. On the other hand, the disadvantage of using the -c, -p, and -r options is that they force you to do your own performance measurements. Fortunately, you can use the command vmstat -s to measure the paging-space activity that occurred while your application ran.

By running the command vmstat -s, running your application, then running the command vmstat -s again, and subtracting the number of paging-space page-ins before from the number of paging-space page-ins after, you can determine the number of paging-space page-ins that occurred while your program ran. Furthermore, by timing your program, and dividing the number of paging-space page-ins by the program's elapsed run time, you can obtain the average paging-space page-in rate.

It is also important to run the application multiple times at each memory size, for two reasons:

  • When changing memory size, the rmss command often clears out a lot of memory. Thus, the first time you run your application after changing memory sizes it is possible that a substantial part of the run time may be due to your application reading files into real memory. But, since the files may remain in memory after your application terminates, subsequent executions of your application may result in substantially shorter elapsed times.
  • To get a feel for the average performance of the application at that memory size. It is impossible to duplicate the system state each time your application runs. Because of this, the performance of your application can vary significantly from run to run.
To summarize, consider the following set of steps as a desirable way to invoke the rmss command:
while there are interesting memory sizes to investigate:
  {
  change to an interesting memory size using rmss -c;
  run the application once as a warm-up;
  for a couple of iterations:
    {
    use vmstat -s to get the "before" value of paging-space page ins;
    run the application, while timing it;
    use vmstat -s to get the "after" value of paging-space page ins;
    subtract the "before" value from the "after" value to get the
       number of page ins that occurred while the application ran;
    divide the number of paging-space page ins by the response time
       to get the paging-space page-in rate;
    }
  }
run rmss -r to restore the system to normal memory size (or reboot)

The calculation of the (after - before) paging I/O numbers can be automated by using the vmstatit script described in Disk or memory-related problem.