Stat caching in Cloud Storage FUSE

This document provides details on stat caching in Cloud Storage FUSE, whichaccelerates file metadata operations for applications thatfrequently check file attributes. Frequent file attribution checks are commonfor many applications that repeatedly check if a file has changed. Statcaching helps reduce the number ofGetMetadata calls for Cloud Storage.

Benefits of stat caching

  • Improved performance for file attribute operations: stat caching storesobject metadata such as file size, modification time, permissions, and otherstandard file attributes. Enabling stat caching significantly speeds upoperations that query these attributes because Cloud Storage can oftenretrieve this information from the local cache.

  • Reduced latency: By serving metadata from the local stat cache,Cloud Storage FUSE avoids network round trips to Cloud Storage for a statobject request, lowering latency of metadata-heavy operations.

  • Negative stat caching: you can cache information about non-existentfiles or directories, meaning if an application frequently checks for afile that isn't there, the negative result can be cached for a shorttime to live (TTL), preventing repeated lookups to Cloud Storage for thesame non-existent path.

Configure stat caching

The stat cache is enabled by default. Configure it by using thegcsfusecommand.

To set the maximum size of the cache, provide a value for one of the following:

Note: This property is a mount-level limit, and actual memory usagemight be lower than the value you specify. Alternatively, you can setthe property to a value of-1 to let the stat cache use as muchmemory as needed.

For more information about default and recommended values for configuringthe stat cache, see theCloud Storage FUSE CLI reference andCloud Storage FUSE configuration file pages.

Configure negative stat caching

Cloud Storage FUSE also offers a negative stat caching capability, which lets youset a TTL for stat cache entries for non-existent files, or negative results.The TTL of the negative stat cache is controlled using one the followingmethods:

To learn more about stat caching, seeCloud Storage FUSE semantics in the Cloud Storage FUSE GitHub documentation.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-17 UTC.