Skip to content

Set socket_timeout for memcached connections to 1s#1429

Merged
vuntz merged 2 commits intocrowbar:masterfrom
vuntz:memcache_socket_timeout
Nov 16, 2017
Merged

Set socket_timeout for memcached connections to 1s#1429
vuntz merged 2 commits intocrowbar:masterfrom
vuntz:memcache_socket_timeout

Conversation

@vuntz
Copy link
Member

@vuntz vuntz commented Nov 13, 2017

The default is 3 seconds, which is very high. When one memcached server
goes down, then every connection pool for memcached (in each process, on
each node) need to identify that this server is down, and that has some
dramatic impact on performance.

Lowering this to 1 second, while still being a reasonable value, helps
quite a bit. I would even consider lowering this to 0.25, but oslo.cache
doesn't support float values there (see
https://bugs.launchpad.net/oslo.cache/+bug/1731921).

Helps with https://bugzilla.suse.com/show_bug.cgi?id=1038223

The default is 3 seconds, which is very high. When one memcached server
goes down, then every connection pool for memcached (in each process, on
each node) need to identify that this server is down, and that has some
dramatic impact on performance.

Lowering this to 1 second, while still being a reasonable value, helps
quite a bit. I would even consider lowering this to 0.25, but oslo.cache
doesn't support float values there (see
https://bugs.launchpad.net/oslo.cache/+bug/1731921).

Helps with https://bugzilla.suse.com/show_bug.cgi?id=1038223
The keystone_authtoken section has some configuration for memcache, and
the default for memcache_pool_socket_timeout is 3 seconds. When one
memcached server goes down, then every connection pool for memcached (in
each process, on each node) need to identify that this server is down,
and that has some dramatic impact on performance.

Lowering this to 1 second, while still being a reasonable value, helps
quite a bit. I would even consider lowering this to 0.25, but
keystonemiddleware doesn't support float values there (see
https://bugs.launchpad.net/oslo.cache/+bug/1731921).

Helps with https://bugzilla.suse.com/show_bug.cgi?id=1038223
@vuntz vuntz requested review from cmurphy and stefannica November 13, 2017 14:00
@vuntz
Copy link
Member Author

vuntz commented Nov 13, 2017

Btw, I noticed that ec2-api doesn't seem to have the memcached settings in keystone_authtoken. Is that intended?

Copy link
Contributor

@stefannica stefannica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure, but I don't think this is needed anymore, because only one memcached server is used - the local one - even when HA is enabled. Please take a look at #1341 and let me know if I'm wrong.

@vuntz
Copy link
Member Author

vuntz commented Nov 14, 2017

I'm not 100% sure, but I don't think this is needed anymore, because only one memcached server is used - the local one - even when HA is enabled. Please take a look at #1341 and let me know if I'm wrong.

Check again, we didn't merge that PR because it's actually incorrect to only use the local memcached server :-)

Copy link
Member

@bmwiedemann bmwiedemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With network latency being in the millisecond range, 1s = 1000ms is actually on the very safe side.

@vuntz vuntz merged commit 175a591 into crowbar:master Nov 16, 2017
gozer-gerrit pushed a commit to ArdanaCLM/glance-ansible that referenced this pull request Dec 21, 2017
The deprecated keystonemiddleware.auth_token in-process token cache
is replaced with a memcached server.

Configure the auth_token keystone middleware for
glance to authenticate and encrypt the token data
stored in memcached.
See Also: https://docs.openstack.org/keystonemiddleware/latest/middlewarearchitecture.html#memcache-protection

Set socket_timeout for memcached connections to 1s.
The default for memcache_pool_socket_timeout is 3 seconds. When one
memcached server goes down, then every connection pool for memcached (in
each process, on each node) need to identify that this server is down,
and that has some dramatic impact on performance.
See crowbar/crowbar-openstack#1429

Merged: Idb8a278d87ea46b1bce335357bce64f74a68dca0
Merged: I65218e71dd0260bf135e733ff4bf5dfde09d7819

Change-Id: I469d2babae33ff4b8602fbbc46584c7960557eb7
gozer-gerrit pushed a commit to ArdanaCLM/cinder-ansible that referenced this pull request Dec 21, 2017
The deprecated keystonemiddleware.auth_token in-process token cache
is replaced with a memcached server.

Configure the auth_token keystone middleware for
glance to authenticate and encrypt the token data
stored in memcached.
See Also: https://docs.openstack.org/keystonemiddleware/latest/middlewarearchitecture.html#memcache-protection

Set socket_timeout for memcached connections to 1s.
The default for memcache_pool_socket_timeout is 3 seconds. When one
memcached server goes down, then every connection pool for memcached (in
each process, on each node) need to identify that this server is down,
and that has some dramatic impact on performance.
See crowbar/crowbar-openstack#1429

Change-Id: I6c178ebbd8bc8847bc160501078325568a3e5728
Merged: Idb8a278d87ea46b1bce335357bce64f74a68dca0
Merged: I65218e71dd0260bf135e733ff4bf5dfde09d7819
openstack-gerrit pushed a commit to openstack/oslo.cache that referenced this pull request Jul 22, 2019
Lowering this setting still allows for reasonable confidence of a
timeout without tanking performance.

Certain downstream projects have already made this optimization:

  crowbar/crowbar-openstack#1429

Change-Id: Iaca2f8cc09a6acae425c020a9d14da3ffde05dec
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Jul 22, 2019
* Update oslo.cache from branch 'master'
  - Lower the memcache_socket_timeout to one second
    
    Lowering this setting still allows for reasonable confidence of a
    timeout without tanking performance.
    
    Certain downstream projects have already made this optimization:
    
      crowbar/crowbar-openstack#1429
    
    Change-Id: Iaca2f8cc09a6acae425c020a9d14da3ffde05dec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants