Skip to content

Commit 51d447b

Browse files
Externalize Keystone secret key cache TTL
The Keystone secret key TTL is hardcoded to 300 seconds (5 minutes). For some use cases, the TTL could be increased, and as a consequence, the number of requests to Keystone is reduced. Therefore, we propose to externalize the configuration as an option that provides this flexibility to operators. The default is maintained as 300 seconds (5 minutes). Signed-off-by: Rafael Weingärtner <[email protected]>
1 parent a3babf1 commit 51d447b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/common/options/rgw.yaml.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,16 @@ options:
844844
services:
845845
- rgw
846846
with_legacy: true
847+
- name: rgw_keystone_token_cache_ttl
848+
type: int
849+
level: advanced
850+
desc: Keystone token secret key cache TTL
851+
long_desc: The TTL for secret keys that are loaded from Keystone and stored in the cache system.
852+
fmt_desc: The maximum TTL that a secret loaded from Keystone is maintained in the token cache system.
853+
default: 300
854+
services:
855+
- rgw
856+
with_legacy: true
847857
- name: rgw_keystone_verify_ssl
848858
type: bool
849859
level: advanced

src/rgw/rgw_auth_keystone.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class SecretCache {
102102
: cct(g_ceph_context),
103103
lock(),
104104
max(cct->_conf->rgw_keystone_token_cache_size),
105-
s3_token_expiry_length(300, 0) {
105+
s3_token_expiry_length(cct->_conf->rgw_keystone_token_cache_ttl, 0) {
106106
}
107107

108108
~SecretCache() {}

0 commit comments

Comments
 (0)