<@U0A71G31CDV> when we have VARIABLES they also li...
# questions-and-troubleshooting
z
@Rocky when we have VARIABLES they also like ADMIN SET CONFIGS? so we should also add that variables into fe config to be persistent after restart?
r
In StarRocks, System Variables and FE Configurations (ADMIN SET CONFIG) behave differently regarding persistence: 1. FE Configurations (
ADMIN SET FRONTEND CONFIG
)
These are not persistent across restarts. * Behavior: When you use
ADMIN SET FRONTEND CONFIG ("key" = "value")
, the change is applied to the running FE process immediately. However, if the FE restarts, it reloads its configuration from the
fe.conf
file. * Action Required: To make these changes permanent, you must manually add the configuration item into your
fe.conf
file. 2. System Variables (
SET GLOBAL ...
)
These are persistent across restarts. * Behavior: System variables (such as
query_mem_limit
,
wait_timeout
, etc.) are stored in the FE's internal metadata (the BDBJE catalog). When you run
SET GLOBAL <var_name> = <value>
, the change is written to the metadata and will automatically be reloaded even if the cluster or FE is restarted. * Action Required: You do not need to add these to
fe.conf
. In fact,
fe.conf
does not support system variables; it is only for FE engine parameters (like ports, JVM settings, and cluster management configs). Summary Comparison Feature | Command | Persists after restart? | Action for persistence FE Configs |
ADMIN SET FRONTEND CONFIG
| No | Add to
fe.conf
Global Variables |
SET GLOBAL <var>
| Yes | None (saved in metadata) Session Variables |
SET <var>
| No | Valid only for the current connection Note: If you want a global variable to take effect for the current session as well, remember that
SET GLOBAL
only affects future connections. You usually need to run both:
Copy code
sql
SET query_mem_limit = 137438953472;        -- Current session
SET GLOBAL query_mem_limit = 137438953472; -- Future sessions (persistent)
Referencesquick_start/helm.mdadministration/Meta_recovery.mdsql-reference/System_variable.md