Provided are techniques for determining a tape speed for a next sync
operation. A sync command is received. An average transaction size and an
average host transfer rate of a set of previous sync operations are
calculated. The tape speed for the next sync operation is determined
using the average transaction size, the average host transfer rate, and a
backhitch time. Data is written to a tape cartridge using the determined
tape speed.