# Expected behavior of Keystone memcached tokens?

My team has a use case for Keystone memcached tokens and I want to confirm what I saw when I was playing with this configuration. I turned on memcached and was able to create and validate tokens. I then queried memcached for the tokens and I saw them. I did not see the tokens in the database. Is this expected behavior?

It was my understanding that memcache is usually used to support improvement of read access so the initial write is to the database, and any reads after the first one is from memcache; hence tokens should appear in both places.

From the code, it looks like the backend only talks to memcache, but I want to make sure that this is the design intent. Thanks in advance.

edit retag close merge delete

Sort by » oldest newest most voted

When you use memcached,the tokens will be saved in memcahced instead of database.And tokens need'nt write to database when using memcached.

more
Memcache in services
You want to configure memcache in  the services.  Specifically the authtoken section of your service refers to keystone middleware.  There you want to configure memcache so that keystone middleware makes use of memcache instead of talking to keystone for every request.

http://docs.openstack.org/developer/python-keystoneclient/middlewarearchitecture.html

Use memcache to cache the token in keystone server
In keystone.conf there is cache settings.  enable global cache and then enable token cache and then configure the cache backend for dogpile. Dogphile cache backend can be  inmemory , memcache or mongo db.  BTW this is from icehouse release

more

# Get to know Ask OpenStack

Resources for moderators