opendata / CKAN-Multisite-Plans

Simplifying the process of launching an open data repository. [RETIRED]
Creative Commons Zero v1.0 Universal
20 stars 7 forks source link

1.0 User Sessions Stored in Database by Default #7

Open rossjones opened 9 years ago

rossjones commented 9 years ago
As an Instance Admin I want user sessions to be stored in the Database and for
session length to be defaulted to a reasonable length (e.g. 1d or 7d) so that I don’t
have to worry about sessions on disk using too much disk space and so that sessions 
are better encapsulated

* This should just be a config option but may need checking and may need some discussion 
    as to whether to make this the default for CKAN generally
rossjones commented 9 years ago

CKAN uses beaker for it's session management, and beaker is pretty flexible. A few CKAN instances already use memcached for storing session information, it's probably a lot better place than adding unnecessary pressure on the DB.

It can be enabled by setting the following in the CKAN ini file

beaker.session.type = ext:memcached
beaker.session.url = 127.0.0.1:11211

I believe there are also options for redis and the database.

By default if I recall CKAN uses the filesystem, this is less than ideal, but the database may be equally as bad. In cases where it's an issue it's definitely better to choose an alternative (like redis or memcache).