Skip to main content

Configuration

The client loads configuration from multiple sources. When the same parameter is set in multiple places, the highest-priority source wins:

Priority (highest → lowest):

1. Environment variables (GOOSEFS_*)
2. Properties config file (goosefs-site.properties)
3. Built-in defaults

Use GoosefsConfig::from_properties_auto() to apply the full priority chain. When you construct a context via FileSystemContext::connect(config), a background ConfigRefresher is started automatically (default interval 60s) and reloads transparent-acceleration switches from properties/env.

Minimal Setup

use goosefs_sdk::config::GoosefsConfig;

// Single master
let config = GoosefsConfig::new("127.0.0.1:9200");

// Or discover from env / properties
let config = GoosefsConfig::from_properties_auto()?;

Common environment variables:

VariablePurpose
GOOSEFS_MASTER_ADDRMaster host:port (or comma-separated HA list)
GOOSEFS_AUTH_TYPEnosasl / simple / …
GOOSEFS_USERUsername for SIMPLE auth
GOOSEFS_CONF / properties pathLocation of goosefs-site.properties
GOOSEFS_USER_FILE_REPLICATION_NUMBERBlock-worker selection count (default 1)
GOOSEFS_USER_FILE_REPLICATION_DURABLEASYNC_THROUGH replica target before persist (default 2)
GOOSEFS_USER_FILE_REPLICATION_DURABLE_MINASYNC_THROUGH minimum successful replicas (default 2)
GOOSEFS_USER_FILE_READ_MAX_NODE_RETRYRead candidate pool width / Java maxRetryNode (default 3)
GOOSEFS_USER_FILE_READ_MAX_NODE_RETRYRead candidate pool width / Java maxRetryNode (default 3)
GOOSEFS_USER_FILE_CHECK_BLOCK_REPLICASCheckBlocks probe count; 0 disables (default)
GOOSEFS_METADATA_CACHE_ENABLEDClient metadata cache switch (default true with metadata-cache, else false)
GOOSEFS_METADATA_CACHE_EXPIRATIONMetadata cache TTL (10min, 30s, or raw ms)
GOOSEFS_METADATA_CACHE_MAX_SIZEMetadata cache LRU capacity (default 100000)
GOOSEFS_FILE_METADATA_SYNC_INTERVALMetadata sync interval (parseTimeSize; default -1. 0 skips cache on every get/list)
GOOSEFS_FILE_METADATA_LOAD_TYPEONCE / ALWAYS / NEVER (default ONCE. ALWAYS skips listing cache)
GOOSEFS_USER_FILE_PERSIST_ON_RENAMEAsync-persist destination on rename (default false)

Write / Read Types

EnumTypical use
WriteType::MustCacheCache only (no UFS persist)
WriteType::CacheThroughWrite cache + UFS synchronously
WriteType::ThroughWrite UFS directly
WriteType::AsyncThroughWrite cache, persist UFS asynchronously
ReadType::CachePopulate worker cache on miss
ReadType::NoCacheDo not back-fill worker/client cache write path

Client Local Page Cache (opt-in)

Disabled by default. Compile with the page-cache crate feature, then enable via fields, properties, or env:

Property keyFieldDefault
goosefs.user.client.cache.enabledclient_cache_enabledfalse
goosefs.user.client.cache.page.sizeclient_cache_page_size1MB
goosefs.user.client.cache.sizeclient_cache_size20 GiB
goosefs.user.client.cache.dirsclient_cache_dirs/tmp/goosefs_cache
goosefs.user.client.cache.eviction.policyclient_cache_evictorLFU (LRU / S3FIFO)
goosefs.user.client.cache.sync.read.enabledclient_cache_sync_read_enabledfalse (Linux only; analytical workloads on local NVMe — see Page Cache → Sync pread read mode)

See Page Cache for a full walkthrough.

Client Metadata Cache (requires metadata-cache)

On by default once the metadata-cache crate feature is compiled in (the Java client defaults it to false). Without that feature the switch defaults to false and turning it on at runtime is a configuration error. get_status / exists / open_file / non-recursive list_status share one process-local TTL-bounded LRU:

Property keyFieldDefault
goosefs.user.metadata.cache.enabledmetadata_cache_enabledtrue with metadata-cache / false otherwise
goosefs.user.metadata.cache.max.sizemetadata_cache_max_size100000
goosefs.user.metadata.cache.expiration.timemetadata_cache_expiration10min
goosefs.user.file.metadata.sync.intervalfile_metadata_sync_interval-1
goosefs.user.file.metadata.load.typefile_metadata_load_typeONCE

This replaces the removed FileInfo open cache (goosefs.user.file.info.cache.*). See Metadata Cache for hit/bypass rules, invalidation, env vars, and metrics.

Worker Connection Pool

Default worker_connection_pool_size is min(cores, 4) (capped), using available_parallelism so cgroup CPU limits are respected on Linux. Opt back to a single channel with:

config.with_worker_connection_pool_size(1);
// or property: goosefs.client.worker.connection.pool.size=1

Full Parameter Reference

The complete field / env / properties / options matrix lives in the repository:

docs/CLIENT_CONFIGURATION.md