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_READ_MAX_NODE_RETRYRead candidate pool width / Java maxRetryNode (default 3)
GOOSEFS_USER_FILE_CHECK_BLOCK_REPLICASCheckBlocks probe count; 0 disables (default)

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. 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
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.

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