This document describes how to use a Cloud Storage FUSE configuration file to
configure the behavior of Cloud Storage FUSE
in a persistent manner. To use the
configuration file, specify the path to the configuration file in the --config-file
option when you run the gcsfuse
command
.
The Cloud Storage FUSE configuration file is a YAML file that uses the following format and fields. Behavior controlled by the configuration file fields can also be set using the Cloud Storage FUSE CLI .
Cloud Storage FUSE configuration file format and fields
The following YAML configuration example shows the format and fields available in Cloud Storage FUSE.
app-name : "APP_NAME" logging : file-path : "FILE_PATH" format : FORMAT severity : SEVERITY log-rotate : max-file-size-mb : MAX_FILE_SIZE backup-file-count : BACKUP_FILE_COUNT compress : COMPRESS cache-dir : "CACHE_DIR" file-cache : max-size-mb : MAX_SIZE cache-file-for-range-read : CACHE_FILE_FOR_RANGE_READ enable-parallel-downloads : ENABLE_PARALLEL_DOWNLOADS parallel-downloads-per-file : PARALLEL_DOWNLOADS_PER_FILE max-parallel-downloads : MAX_PARALLEL_DOWNLOADS download-chunk-size-mb : DOWNLOAD_CHUNK_SIZE metadata-cache : enable-nonexistent-type-cache : ENABLE_NONEXISTENT_TYPE_CACHE negative-ttl-secs : ENABLE_NEGATIVE_TTL_SECS stat-cache-max-size-mb : STAT_CACHE_MAX_SIZE ttl-secs : TTL_SECS type-cache-max-size-mb : TYPE_CACHE_MAX_SIZE only-dir : "ONLY_DIR" gcs-auth : anonymous-access : ANONYMOUS_ACCESS key-file : "KEY_FILE" reuse-token-from-url : REUSE_TOKEN_FROM_URL token-url : "TOKEN_URL" gcs-connection : billing-project : "BILLING_PROJECT" client-protocol : CLIENT_PROTOCOL custom-endpoint : "CUSTOM_ENDPOINT" http-client-timeout : HTTP_CLIENT_TIMEOUT limit-bytes-per-sec : "LIMIT_BYTES_PER_SEC" limit-ops-per-sec : "LIMIT_OPS_PER_SEC" max-conns-per-host : MAX_CONNS_PER_HOST max-idle-conns-per-host : MAX_IDLE_CONNS_PER_HOST sequential-read-size-mb : SEQUENTIAL_READ_SIZE implicit-dirs : IMPLICIT_DIRS file-system : kernel-list-cache-ttl-secs : KERNEL_LIST_CACHE_TTL_SECS ignore-interrupts : IGNORE_INTERRUPTS dir-mode : "DIR_MODE" file-mode : "FILE_MODE" fuse-options : FUSE_OPTIONS gid : GID rename-dir-limit : RENAME_DIR_LIMIT temp-dir : "TEMP_DIR" uid : UID foreground : FOREGROUND gcs-retries : max-retry-attempts : MAX_RETRY_ATTEMPTS max-retry-sleep : MAX_RETRY_SLEEP multiplier : "MULTIPLIER" metrics : cloud-metrics-export-interval-secs : CLOUD_METRICS_EXPORT_INTERVAL prometheus-port : PROMETHEUS_PORT debug : log-mutex : LOG_MUTEX exit-on-invariant-violation : EXIT_ON_INVARIANT_VIOLATION write : enable-streaming-writes : STREAMING_WRITES global-max-blocks : MAXIMUM_GLOBAL_BLOCKS read : enable-buffered-read : ENABLE_BUFFERED_READ global-max-blocks : MAXIMUM_GLOBAL_READ_BLOCKS profile : PROFILE
Cloud Storage FUSE configuration file fields
The following table describes the fields you can specify in your Cloud Storage FUSE configuration file. Unless stated otherwise, all fields are optional.
app-name
"my-bucket-mount"
. file-path
stdout
when Cloud Storage FUSE runs in
foreground mode and to syslogs
when Cloud Storage FUSE runs in
background mode."/var/log"
. format
-
text -
json
json
severity
The severity level you want Cloud Storage FUSE to generate logs for. The
severity levels are ordered from lowest severity to highest severity. For
example, when you specify warning
, Cloud Storage FUSE generates logs
for warnings and errors. Generally, we recommend using the info
severity level.
-
off: disables all logging. -
error: contains messages about serious issues that prevent Cloud Storage FUSE from completing an operation, or indicate a failure such as mount failures, permission errors, and critical input/output (I/O) errors. -
warning: contains messages indicating potential issues that aren't critical but can lead to issues if not addressed. Potential issues include non-fatal connection issues, deprecation warnings, resource contention that might cause slight performance degradation, and retries for transient failures. This severity level also includes information provided in theerrorseverity level. -
info: contains logging information such as startup and shutdown messages, or information about successful mount operations, progress updates, and configuration settings. This severity level also includes information about thewarninganderrorseverity levels. -
debug: contains logging information such as startup and shutdown messages, or information about successful mount operations, progress updates, and configuration settings. This severity level also includes the information provided in theinfo,warning, anderrorseverity levels. -
trace: contains granular details about each Cloud Storage FUSE operation and function call, outlining thegcsfuseinteraction with the kernel FUSE driver and Cloud Storage. This severity level also includes the details provided indebug,info,warning, anderrorseverity levels.
info
max-file-size-mb
1
.512
backup-file-count
- Integer
-
0: Retains all rotated log files
10
compress
true
, false
true
cache-dir
Enables the file cache and specifies the directory for storing file cache data.
"/tmp/gcsfuse-cache-path"
.
An empty value indicates this field is disabled. This field is disabled
by default. max-size-mb
Specifies the maximum size in MiB that the file cache can use and lets you limit the total capacity the file cache can use within its mounted directory.
- Integer
-
-1: Specifies the use of the cache's entire available capacity in the directory you specify forcache-dir. This is the default only ifcache-diris passed. -
0: Disables the file cache.
-1
cache-file-for-range-read
true
if you plan to perform several random reads
or partial reads.
true
, false
false
enable-parallel-downloads
Accelerates reads of large files by using the file cache directory as a prefetch buffer using multiple workers to download multiple parts of a file in parallel.
Parallel downloads are automatically enabled when you enable file caching. To learn more about file caching, see Use Cloud Storage FUSE file caching .
To learn more about parallel downloads and how to configure supporting properties, Parallel downloads .
true
, false
.true
parallel-downloads-per-file
16
max-parallel-downloads
- Integer
-
-1: Specifies unlimited parallel downloads. -
0: Disables parallel downloads. Can only be used if--enable-parallel-downloadsis not passed or is passed asfalse.
16
,
whichever is higher. download-chunk-size-mb
200
enable-nonexistent-type-cache
NonexistentType
if a file isn't found in Cloud Storage. If the file gets created
in Cloud Storage but the NonexistentType
entry for
the file is cached, then Cloud Storage FUSE cannot request that file until
the NonexistentType
entry is removed from the type cache.true
, false
false
stat-cache-max-size-mb
- Integer. We recommend the following:
-
32if your workload involves up to 20,000 files. - If your workload is larger than 20,000 files, increase the size by values of 10 for every additional 6,000 files, where the stat cache uses an average of 1,500 MiB per file.
-
-1: Sets no limit, where the stat cache use as much memory as needed. -
0: Disables the stat cache.
32
negative-ttl-secs
Defines the time to live (TTL) in seconds of negative stat cache entries, which store results for non-existent files in the cache.
- Integer representing seconds, for example:
10(10 seconds). -
0: Disables negative stat caching. -
-1: Allows unlimited negative stat caching and disables a TTL expiration.
5
ttl-secs
- Integer representing seconds, for example:
30(30 seconds). -
-1: Bypass TTL expiration and serve files from the cache whenever they're available. -
0: Use the most up-to-date file. Using this value issues aGetmetadata call to make sure that the object generation for the file in the cache matches what's stored in Cloud Storage.
60
type-cache-max-size-mb
- Integer. We recommend the following:
-
4if the maximum number of files within a single directory from the bucket you're mounting contains 20,000 files or less. - If the maximum number of files within a single
directory that you're mounting contains more than 20,000 files, increase
the value by
1for every 5,000 files, which is an average of around 200 bytes per file.
-
-
-1: Specifies no limit and lets the type cache use as much memory as needed. -
0: Disables the type cache.
4
only-dir
"/etc/gcsfuse.yaml"
. anonymous-access
true
, false
false
key-file
reuse-token-from-url
--token-url
.true
, false
true
token-url
--key-file
is absent. billing-project
client-protocol
-
http1for HTTP/1.1 -
http2for HTTP/2 -
grpcfor gRPC . To use gRPC with Cloud Storage FUSE, we recommend using Cloud Storage FUSE versions 2.10.0 or newer.
http1
custom-endpoint
storage. UNIVERSE_DOMAIN_NAME
:443
.
If a custom endpoint isn't specified, Cloud Storage FUSE uses the global
Cloud Storage JSON API endpoint, storage.googleapis.com:443
.
If authentication isn't supported on the custom endpoint you specify, set
the anonymous-access
field to true
to
bypass authentication.storage.googleapis.com:443
.
http-client-timeout
1h10m10s
for 1 hour, 10 minutes,
and 10 seconds. 0s
specifies no timeout.0s
, which specifies no timeout limit-bytes-per-sec
"-1"
, which specifies no limit. limit-ops-per-sec
-1
specifies no limit."-1"
max-conns-per-host
--client-protocol
is set to http1
.0
max-idle-conns-per-host
--client-protocol
is set to http1
.0
and 2147483647
. 0
specifies no limit on TCP connections.0
sequential-read-size-mb
1
and 1024
.200
implicit-dirs
true
, false
false
kernel-list-cache-ttl-secs
- Integer representing seconds, for example:
10(10 seconds). -
0: Disables list caching. -
-1: Bypasses entry expiration and always returns the list response from the cache when it's available.
0
ignore-interrupts
Control+C
. This prevents signals from
terminating in-flight operations.true
, false
.true
dir-mode
000
and 777
(inclusive)."755"
file-mode
000
and 777
(inclusive)."644"
gid
- Integer representing a GID.
-
-1: The GID of the caller is used.
-1
rename-dir-limit
0
and 2147483647
.0
temp-dir
"/mnt/ssd/example-user-gcsfuse-temp-dir"
."/tmp"
uid
- Integer representing a UID.
-
-1: The UID of the caller is used.
-1
foreground
gcsfuse
command in the foreground.true
, false
false
max-retry-attempts
- Integer representing the maximum number of retry attempts, for example:
10. -
0: Allows unlimited retry attempts.
0
max-retry-sleep
1h5m50s
(1 hour, 5 minutes, and
50 seconds) or 60s
(60 seconds).30s
multiplier
"2"
cloud-metrics-export-interval-secs
Exports metrics to Cloud Monitoring with the specified interval.
10
(10 seconds). 0
specifies no exporting.0
prometheus-port
Exposes Prometheus metrics endpoint on the specified port and /metrics
path.
0
log-mutex
trace
, which includes trace logs, debug logs, info logs,
warning logs, and error logs.true
, false
.false
exit-on-invariant-violation
true
, false
.false
enable-streaming-writes
close()
or fsync()
.
For more information about streaming writes, see Reads/Writes
in the Cloud Storage FUSE GitHub documentation.true
, false
.true
global-max-blocks
Specifies the maximum number of data chunks available for streaming writes across all files. Each file uses one 32 MiB data chunk by default.
- Integer
-
0: disables streaming writes. -
-1: sets the value to unlimited chunks.
- Default value for low-specification machines with limited resources:
4 - Default value for high-specification machines with a large amount of
resources:
1600
enable-buffered-read
true
, false
false
read:global-max-blocks
Specifies the maximum number of blocks available for buffered reads across all file handles.
- Integer
-
0: disables buffered reads. -
-1: sets the value to unlimited blocks.
40
profile
- A string, for example,
"aiml-checkpointing". -
"aiml-training": optimizes performance for high throughput reads of large datasets and prevents Cloud GPUs and Cloud TPU hardware from waiting for data. -
aiml-checkpointing: optimizes performance for high throughput writes for large files by drastically reducing the time it takes to save multi-gigabyte checkpoints, minimizing training pauses. -
aiml-serving: optimizes performance for serving workloads by streamlining data access and applying caching mechanisms.
""

