nodetool getauthcacheconfig
Cassandra 4.1+
This command is available in Cassandra 4.1 and later.
Displays authentication cache configuration settings.
Synopsis
Section titled “Synopsis”nodetool [connection_options] getauthcacheconfig --cache-name <cache>See connection options for connection options.
Options
Section titled “Options”| Option | Description |
|---|---|
--cache-name <cache> | Required. Cache to query: CredentialsCache, PermissionsCache, RolesCache, or NetworkPermissionsCache |
Description
Section titled “Description”nodetool getauthcacheconfig displays the current configuration of a specific Cassandra authentication or authorization cache. These caches improve performance by storing authentication credentials and authorization decisions, reducing the need to query system tables for every operation.
Output Fields
Section titled “Output Fields”| Field | Description |
|---|---|
Validity Period | How long cache entries remain valid |
Update Interval | Background refresh interval |
Max Entries | Maximum entries in cache |
Active Update | Whether entries are actively refreshed before expiry |
Examples
Section titled “Examples”Query Credentials Cache
Section titled “Query Credentials Cache”nodetool getauthcacheconfig --cache-name CredentialsCacheSample output:
Validity Period: 2000 msUpdate Interval: 1000 msMax Entries: 1000Active Update: trueQuery Permissions Cache
Section titled “Query Permissions Cache”nodetool getauthcacheconfig --cache-name PermissionsCacheQuery All Caches
Section titled “Query All Caches”for cache in CredentialsCache PermissionsCache RolesCache NetworkPermissionsCache; do echo "=== $cache ===" nodetool getauthcacheconfig --cache-name $cachedoneWhen to Use
Section titled “When to Use”Performance Tuning
Section titled “Performance Tuning”# Check current cache settingsnodetool getauthcacheconfigReview cache configuration when:
- Experiencing authentication latency
- Seeing high load on system_auth keyspace
- Planning changes to authentication patterns
- Troubleshooting authorization delays
Security Configuration Audit
Section titled “Security Configuration Audit”# Document auth cache settingsnodetool getauthcacheconfig > auth_cache_config.txtDuring security audits, document cache validity periods to understand how quickly permission changes take effect.
Before Modifying Settings
Section titled “Before Modifying Settings”# Check current config before changesnodetool getauthcacheconfig
# Make changesnodetool setauthcacheconfig --permissions-validity 5000
# Verify changesnodetool getauthcacheconfigConfiguration Parameters Explained
Section titled “Configuration Parameters Explained”Validity Period
Section titled “Validity Period”The validity period determines how long cached entries are considered valid:
- Short validity (e.g., 2000ms): Permission changes take effect quickly, but higher load on system tables
- Long validity (e.g., 60000ms): Better performance, but permission changes are delayed
Update Interval
Section titled “Update Interval”Controls background refresh of cache entries:
- Entries are refreshed before they expire
- Should be less than validity period
- Prevents authentication storms when entries expire
Max Entries
Section titled “Max Entries”Limits cache size to prevent memory issues:
- Set based on expected number of unique credentials/roles
- Entries are evicted using LRU when limit is reached
- Monitor cache efficiency to tune appropriately
Best Practices
Section titled “Best Practices”Cache Tuning Guidelines
- Balance security and performance - Shorter validity means faster permission propagation but more system_auth load
- Monitor cache effectiveness - Track hit rates and latency
- Size appropriately - Max entries should accommodate typical concurrent users
- Consider workload patterns - High connection rate applications may need larger caches
Default Values
Default cache settings are conservative (2000ms validity). Production environments may benefit from tuning based on:
- Number of authenticated users
- Connection rate patterns
- Acceptable delay for permission changes
- System_auth keyspace capacity
Security Trade-Off
Longer cache validity improves performance but delays permission revocations. Consider:
- How quickly must permission changes take effect?
- What is acceptable risk window for revoked credentials?
- Balance against system_auth query load
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| setauthcacheconfig | Modify cache settings |
| invalidatecredentialscache | Clear credentials cache |
| invalidatepermissionscache | Clear permissions cache |
| invalidaterolescache | Clear roles cache |