Change memcache_socket_timeout to a float

It's not unusual to set 0.25 as a socket_timeout value, and this was
not possible. This can have a dramatic impact for performance when one
memcached server is down, especially when keystone is involved.

Change-Id: I01356b7873ad78cb38779f5c5ddd2b932889c911
Partial-Bug: #1731921
This commit is contained in:
Vincent Untz 2017-11-13 14:36:19 +01:00 committed by Bogdan Dobrelya
parent bcabe943fe
commit 6f320b4b98
3 changed files with 11 additions and 6 deletions

View File

@ -76,11 +76,11 @@ FILE_OPTIONS = {
help='Number of seconds memcached server is considered dead'
' before it is tried again. (dogpile.cache.memcache and'
' oslo_cache.memcache_pool backends only).'),
cfg.IntOpt('memcache_socket_timeout',
default=3,
help='Timeout in seconds for every call to a server.'
' (dogpile.cache.memcache and oslo_cache.memcache_pool'
' backends only).'),
cfg.FloatOpt('memcache_socket_timeout',
default=3.0,
help='Timeout in seconds for every call to a server.'
' (dogpile.cache.memcache and oslo_cache.memcache_pool'
' backends only).'),
cfg.IntOpt('memcache_pool_maxsize',
default=10,
help='Max total number of open connections to every'

View File

@ -45,7 +45,7 @@ class PooledMemcachedBackend(memcached_backend.MemcachedBackend):
self.url,
arguments={
'dead_retry': arguments.get('dead_retry', 5 * 60),
'socket_timeout': arguments.get('socket_timeout', 3),
'socket_timeout': arguments.get('socket_timeout', 3.0),
},
maxsize=arguments.get('pool_maxsize', 10),
unused_timeout=arguments.get('pool_unused_timeout', 60),

View File

@ -0,0 +1,5 @@
---
features:
- |
`memcache_socket_timeout` is changed to float, given the same default value
'3.0'.