<@U0A71G31CDV> explain all session , gloabl variab...
# questions-and-troubleshooting
y
@Rocky explain all session , gloabl variable that are to be set when testing no spill local disk spilling and remote disk spilling
r
Here's what the docs support for the three test setups. All the
SET
items below are FE session variables — use
SET <var>
for your own session, or
SET GLOBAL <var>
to affect sessions started afterwards (docs state the scope explicitly only for some of them;
disable_spill_to_local_disk
and
spill_encode_level
are listed as
Scope: Session
). 1. No spill (baseline)
Copy code
sql
SET enable_spill = false;                    -- default false
-- nothing else needed; remote spill is off by default too
SET enable_spill_to_remote_storage = false;  -- default false
SET spill_storage_volume = '';               -- default ''
2. Local disk spill Prerequisite (BE/CN config, restart required):
Copy code
properties
spill_local_storage_dir=/<dir_1>[/</dir_2>...]   # ';' separated kinds of paths: /<dir_1>;/<dir_2>
Copy code
sql
SET enable_spill = true;
SET spill_mode = 'force';          -- 'auto' (default) or 'force'
SET enable_spill_to_remote_storage = false;
•
spill_mode='force'
spills all spillable operators regardless of memory — that's what you want for deterministic testing;
auto
only spills under memory pressure. • Keep remote off, otherwise local is still used first anyway. • Optional knobs:
spill_encode_level
(session, default 7),
spill_mem_limit_threshold
(session, default 0.8 — the auto-mode trigger),
spill_revocable_max_bytes
(default 0 = off), plus hidden-but-settable
spill_mem_table_size
,
spill_mem_table_num
,
spill_rand_ratio
. • BE side:
spill_max_dir_bytes_ratio
(default 0.5, read at BE start) limits a spill dir that shares a disk with `storage_root_path`;
query_pool_spill_mem_limit_threshold
(default 1.0);
query_scratch_dirs
is a separate scratch-path config. 3. Remote (object storage) spill Prerequisite: a storage volume must exist (
CREATE STORAGE VOLUME ...
).
Copy code
sql
SET enable_spill = true;
SET spill_mode = 'force';
SET enable_spill_to_remote_storage = true;       -- v3.3.0+, default false
SET spill_storage_volume = '<storage_volume_name>';  -- default ''
Default behavior with remote enabled: local disk is used first, object storage only once the local capacity limit is reached. To test remote-only (no local disk at all):
Copy code
sql
SET disable_spill_to_local_disk = true;   -- session, default false, v3.3.0+
Caveats the docs call out for `disable_spill_to_local_disk`: it only has effect when
enable_spill=true
,
enable_spill_to_remote_storage=true
, and
spill_storage_volume
resolves to a real volume; if the volume doesn't exist, remote spill silently isn't enabled (and this setting does nothing). Disabling local spill raises network I/O and latency. Practical notes for tests • Remote spill is a preview/Beta feature and is significantly slower than local disk; spilling generally is ~10x slower, so raise
query_timeout
for spill tests. •
spill_local_storage_dir
must not equal or share a disk with
storage_root_path
— BE refuses to start otherwise (also fails if the dir isn't writable, unless
ignore_broken_disk
is true). • Spilled data is cleaned per query at completion; leftovers are cleared on BE restart. One thing I couldn't confirm from the docs: an authoritative list of profile/metric names to verify that spilling actually occurred — check the query profile in the FE/BE web UI for that. References • sql-reference/System_variable.md • administration/management/resource_management/spill_to_disk.md • knowledge/qa/spill_to_disk.md (StarRocks knowledge base)