Monitoring largest file system entities
A method for monitoring largest file system entities of a file system that is stored in a storage system, the method may include populating, during multiple population iterations, a cache of the storage system with largest file system entities metadata; wherein a current population iteration of the multiple population iterations may include pushing, to a heap, metadata related to a set of one or more file system entities that are children of a parent file system entity that was deemed a largest file system entity of a last population iteration that preceded the current population iteration; popping the heap to provide a current largest file system entity; and storing metadata related to the current largest file system entity in the cache.
1 . A method for monitoring largest file system entities of a file system that is stored in a storage system, the method comprises:
populating, during multiple population iterations, a cache of the storage system with metadata related to largest file system entities among multiple file system entities of the file system, wherein the populating is done regardless of a file system level that is associated with each of the largest file system entities; and without storing in the cache, metadata related to file system entities that differ from the largest file system entities;
wherein a current population iteration of the multiple population iterations comprises:
pushing, to a heap, metadata related to a set of one or more file system entities that are children of a parent file system entity that was deemed a largest file system entity of a last population iteration that preceded the current population iteration; wherein the parent file system entity was popped from the heap during the last population iteration; wherein the parent file system entity comprises one or more directories that comprise all files of the children;
popping the heap to provide a current largest file system entity being the largest file system entity among all file system entities that currently exist in the heap, and wherein metadata of the current largest file system entity was not cached by any previous population iteration of the multiple population iterations; and
storing metadata related to the current largest file system entity in the cache.
2 . The method according to claim 1 wherein a first current population iteration comprises pushing to the heap metadata related to children of a root of the file system.
3 . The method according to claim 1 comprising ending the populating when the heap is empty.
4 . The method according to claim 1 comprising ending the populating when the cache is full.
5 . The method according to claim 1 comprising ending the populating when a size of current largest file system entity is below a size threshold.
6 . The method according to claim 1 comprising ending the populating when a size of current largest file system entity is below a predefined fraction of an overall size of the file system.
7 . The method according to claim 1 wherein the metadata related to the current largest file system entity comprises size information, and identification information.
8 . The method according to claim 1 comprising receiving a query related to the one or more largest file system entities of the file system, and responding to the query using at least at part of the metadata related to the largest file system entities that is stored in the cache.
9 . The method according to claim 8 comprising detecting a cache miss when a difference between (i) an aggregate size of a parent file system entity and children of the parent file system entity, and (ii) a size of the parent file system entity, exceeds an aggregate size of children of the parent file system entity that have their metadata cached.
10 . A non-transitory computer readable medium for monitoring largest file system entities of a file system that is stored in a storage system, the non-transitory computer readable medium stores instructions for:
populating, during multiple population iterations, a cache of the storage system with metadata related to largest file system entities among multiple file system entities of the file system, wherein the populating is done regardless of a file system level that is associated with each of the largest file system entities: without storing in the cache, metadata related to file system entities that differ from the largest file system entities;
wherein a current population iteration of the multiple population iterations comprises:
pushing, to a heap, metadata related to a set of one or more file system entities that are children of a parent file system entity that was deemed a largest file system entity of a last population iteration that preceded the current population iteration; wherein the parent file system entity was popped from the heap during the last population iteration; wherein the parent file system entity comprises one or more directories that comprise all files of the children;
popping the heap to provide a current largest file system entity being the largest file system entity among all file system entities that currently exist in the heap, and wherein metadata of the current largest file system entity was not cached by any previous population iteration of the multiple population iterations; and
storing metadata related to the current largest file system entity in the cache.
11 . The non-transitory computer readable medium according to claim 10 wherein a first current population iteration comprises pushing to the heap metadata related to children of a root of the file system.
12 . The non-transitory computer readable medium according to claim 10 that stores instructions for ending the populating when the heap is empty.
13 . The non-transitory computer readable medium according to claim 10 that stores instructions for ending the populating when the cache is full.
14 . The non-transitory computer readable medium according to claim 10 that stores instructions for ending the populating when a size of current largest file system entity is below a size threshold.
15 . The non-transitory computer readable medium according to claim 10 that stores instructions for ending the populating when a size of current largest file system entity is below a predefined fraction of an overall size of the file system.
16 . The non-transitory computer readable medium according to claim 10 wherein the metadata related to the current largest file system entity comprises size information, and identification information.
17 . The non-transitory computer readable medium according to claim 10 that stores instructions for receiving a query related to the one or more largest file system entities of the file system, and responding to the query using at least at part of the metadata related to the largest file system entities that is stored in the cache.
18 . The non-transitory computer readable medium according to claim 17 that stores instructions for detecting a cache miss when a difference between (i) an aggregate size of a parent file system entity and children of the parent file system entity, and (ii) a size of the parent file system entity, exceeds an aggregate size of children of the parent file system entity that have their metadata cached.
19 . A storage system comprising:
a cache;
at least one storage system compute element that is configured to:
populate, during multiple population iterations, the cache with metadata related to the largest file system entities among multiple file system entities of a file system stored in the storage system, wherein the at least one storage system compute element is configured to populate regardless of a file system level that is associated with each of the largest file system entities, and without storing in the cache, metadata related to file system entities that differ from the largest file system entities;
wherein a current population iteration of the multiple population iterations comprises:
pushing, to a heap, metadata related to a set of one or more file system entities that are children of a parent file system entity that was deemed a largest file system entity of a last population iteration that preceded the current population iteration; wherein the parent file system entity was popped from the heap during the last population iteration; wherein the parent file system entity comprises one or more directories that comprise all files of the children;
popping the heap to provide a current largest file system entity being the largest file system entity among all file system entities that currently exist in the heap, and wherein metadata of the current largest file system entity was not cached by any previous population iteration of the multiple population iterations; and
storing metadata related to the current largest file system entity in the cache.