Project

General

Profile

Actions

Task #12827

closed

Configure CKAN to store .cache files (that are session info) in memory

Added by Francesco Mangiacrapa over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
_InfraScience Systems Engineer
Category:
Application
Target version:
Start date:
Nov 06, 2018
Due date:
% Done:

100%

Estimated time:
Infrastructure:
Development, Production

Description

@tommaso.piccioli@isti.cnr.it has noticed under '/tmp/[ckan_name]/sessions' directory that milions of file are created by CKAN.
Investigating the issue we have found (from https://lists.okfn.org/pipermail/ckan-dev/2015-February/008648.html) the following one:

The cache directory or the session directory is only used for stuff that is not saved in the database.  
It is always safe to remove.  It is only used for very temporary data.
CKAN only uses it in fact to store the little popup messages that come up after you are redirected to a new page.

... but those files are never deleted.

We need and can (in order to avoid filling the disk) to pass from caching on disk to cacking in memory by installing
and configuring memcached (see at https://github.com/memcached/memcached) for pylons and beaker.

How to install and use it:

https://stackoverflow.com/questions/13781023/how-to-configure-ckan-to-store-sessions-somewhere-other-than-disk-e-g-db-or-me

https://beaker.readthedocs.io/en/latest/sessions.html#deleting

Actions #1

Updated by Andrea Dell'Amico over 6 years ago

  • Status changed from New to In Progress

Going to reconfigure the dev instance.

Actions #2

Updated by Andrea Dell'Amico over 6 years ago

  • % Done changed from 0 to 70

Functionality active in dev. The variable

ckan_memcache_sessions: True

must be created under group_vars/ckan_prod/ckan_prod.yml to enable it on all the production instances. Then, the playbook must be run with the following options:

./run.sh ckan.yml -i inventory/hosts.dev -l ckan_dev -t ckan_memcache,memcache

(change the inventory file and the target host).

@francesco.mangiacrapa@isti.cnr.it can you check if the dev instance is working correctly?

Actions #3

Updated by Francesco Mangiacrapa over 6 years ago

Hi @andrea.dellamico@isti.cnr.it,

I just performed some tests in dev and the catalogue ckan-d seems to work fine. I also published an item without any problem.

Actions #4

Updated by Andrea Dell'Amico over 6 years ago

I see that the sessions directory under /tmp is empty and I see CKAN sessions into the memcache data, so I guess the configuration can be extended to the production nodes. Maybe starting next monday?

Actions #5

Updated by Andrea Dell'Amico over 6 years ago

Reconfiguration of the sobigdata ckan servers is ongoing. It will take some time, because the old sessions data is being removed.

Actions #6

Updated by Andrea Dell'Amico over 6 years ago

  • Assignee changed from _InfraScience Systems Engineer to Francesco Mangiacrapa
  • % Done changed from 70 to 90

@francesco.mangiacrapa@isti.cnr.it will decide when reconfigure the remaining CKAN instances.

Actions #7

Updated by Andrea Dell'Amico over 6 years ago

  • Status changed from In Progress to Closed
  • Assignee changed from Francesco Mangiacrapa to _InfraScience Systems Engineer
  • % Done changed from 90 to 100

All the servers have been reconfigured.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 8.91 MB)