Copy Optical (CPYOPT) command performance

Performance is a complex subject with many interdependent components.

By changing one component, you may adversely affect another. This interdependence and the other factors that affect performance prohibit providing a formula for computing the time required to copy a given number of files. It is a guideline to help you estimate how long your CPYOPT command might take.

You may need to estimate how long it takes to copy an entire optical volume when using the CPYOPT command. You can start by copying a single directory that contains a known number of average sized files. Then take the difference between the ending time and starting time to determine an elapsed time. Take the elapsed time and divide by the number of files that are copied to figure the average seconds per file. You can use this number as a basis to determine the amount of time that is required to copy the entire volume of average size files.

To maximize copy performance, use the following set of guidelines as a starting point:
  • Having too few directories with too many files can affect performance. Having too many directories with too few files can affect performance also. Try to keep the number of files in a directory to less than 6000 files.
  • Consider performance when determining file size.
  • Avoid the use of extended attributes on files. When a file has extended attributes, they are stored separately from the data. When copying the data, the system must copy the attributes also. It is similar to copying a second file for each user file copied.
  • Keep the source and target volumes in the same library.
  • Avoid copying to the opposite side of an optical cartridge.
  • If the copy processes can have dedicated use of the optical drives, use the COPYTYPE *IOP parameter on the CPYOPT command.
  • Avoid optical drive contention from other optical processes.
  • Dedicate the use of two optical drives for copy activity.
The following conditions can severely affect copy performance:
  • Having only one drive available for use.
  • Copying from one side of an optical cartridge to the opposite side.
  • Having other optical processes that are running that attempt to use the available drives.
  • A large number of files on the source volume.

The process of removing a volume, storing it in a slot, retrieving a new volume, and mounting it requires from 8 to 15 seconds. You should try to do your copy requests when the process can have dedicated use of the optical drives.

Do not try to copy a large number of files from one side of an optical cartridge to the other side. Optical drives have only one read/write head. The following conditions occur when copying from one side of an optical cartridge to another:
  • The system mounts the source volume.
  • A limited number of files that are to be copied are read and stored on IBM® i temporary storage.
  • The source volume is removed, and the system mounts the target volume by turning over the optical cartridge.
  • Files are read from IBM i temporary storage and written to the target volume.
  • If there are more files to copy, the system removes the target volume and mounts the source volume again by turning over the optical cartridge.
  • The system repeats this process until it copies all the files. You may need to turn the optical cartridge over many times to copy all the files.
Copy performance is always better when both the source and target volumes are in the same library and when setting the COPYTYPE parameter for that library controller to *IOP. Two conditions exist that require an extra processing step. The first one is that the source and target volumes are in different libraries. The second involves setting the COPYTYPE parameter to *SYSTEM and having the volumes exist in the same library. This extra step requires moving the files you want to copy to temporary storage on the system before writing them to the target volume. You do not need to use temporary storage when the system meets both of the following conditions:
  • Both optical volumes are in the same library.
  • You set the COPYTYPE parameter on the CPYOPT command to *IOP.

This allows for the direct transfer of data between the two optical drives.