A disk drive is disclosed comprising a disk, a head actuated over the
disk, a host interface for receiving disk access commands from a host, a
command queue for queuing the disk access commands, and a stream
detection engine for evaluating the disk access commands to detect a
plurality of streams accessed by the host. The stream detection engine
maintains a stream data structure for each detected stream, wherein the
stream data structure comprises a frequency counter for tracking a number
of disk access commands associated with the stream out of a predetermined
number of consecutive disk access commands received from the host. A disk
controller selects one of the streams for servicing in response to the
frequency counters.