Patent ID: 7631148

Claim:
A method for a storage operating system implemented in a storage system to optimize an amount of readahead data retrieved from a data container of the storage system, comprising: managing a separate set of readahead metadata for each individual read stream of a plurality of read streams, wherein the read stream is a set of one or more client read requests to retrieve data from a contiguous range of file offsets within a requested file; storing the separate set of readahead metadata in a corresponding individual readset data structure for the each individual read stream; maintaining, in the individual readset data structure, a plurality of factors for the each read stream, the plurality of factors determining the amount of readahead data retrieved from the data container the one or more client read requests; receiving a client read request associated with a particular read stream at the storage system and determining an amount of readahead data to retrieve from the data container for the particular read stream; receiving a next client read request associated with the particular read stream; locating a readset data structure for the particular read stream; determining whether the storage operating system is permitted to retrieve readahead data from the data container in response to the received next client read request; and if it is determined that the storage operating system is permitted to retrieve readahead data from the data container, performing the steps of, (i) modifying one or more of the plurality of factors stored within the readset data structure for the particular read stream; (ii) adjusting, in response to modifying the one or more factors, an amount of readahead data to retrieve for the next client read request associated with the particular read stream, wherein the amount of readahead data to retrieve for the next client read request is different from the amount of readahead data retrieved for the client read request; (iii) retrieving the adjusted amount of readahead data from the data container; and (iv) determining if the readset data structure meets a criteria for being updated, and if the readset data structure meets the criteria then updating the readset data structure.