# Clarification of proper redis config settings

**URL:** <https://community.learningequality.org/t/clarification-of-proper-redis-config-settings/1757>\
**Category:** Kolibri\
**Created:** [September 24, 2020, 1:32pm UTC](https://community.learningequality.org/t/clarification-of-proper-redis-config-settings/1757 "2020-09-24T13:32:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrdavidhaag](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/mrdavidhaag/32/2048_2.png) [@mrdavidhaag](https://community.learningequality.org/u/mrdavidhaag)\
**Post date:** [September 24, 2020, 1:32pm UTC](https://community.learningequality.org/t/clarification-of-proper-redis-config-settings/1757/1 "2020-09-24T13:32:50Z")

</div>

## Summary

Working with new installation of kolibri-server and would like advice on proper redis config settings

## Technical details

![image](https://canada1.discourse-cdn.com/flex035/uploads/learneq/original/1X/bc79078c2344b21482a3d7bbf79f6987da184ccd.png)

Systemctl status kolibri

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/learneq/original/1X/d939ad281d8c37913fca65f0d30ff3b4d2d1d694.png)

I understand the suggestion to add “maxmemory-policy allkeys-lru” and leads me to believe redis in the kolibri-server is used for cache only(?). I have no experience with redis.

From redis docs; “If you plan to use Redis just as a cache where every key will have an expire set you may consider using the following configuration instead (assuming a max memory limit of 2 megabytes as an example):”  
maxmemory 2mb  
maxmemory-policy allkeys-lru

My question is about the maxmemory setting. The VM for this kolibri-server has 16GB of memory. What is suggested amount of maxmemory for kolibri-server?

Kind regards,  
David

---

<div class="post-metadata">

**Author:** ![jonathan](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/jonathan/32/314_2.png) [@jonathan](https://community.learningequality.org/u/jonathan)\
**Post date:** [September 24, 2020, 5:31pm UTC](https://community.learningequality.org/t/clarification-of-proper-redis-config-settings/1757/2 "2020-09-24T17:31:00Z")

</div>

Hi David,

I’m personally not an expert on Redis config either, but there was a recent [thread on the forum](https://community.learningequality.org/t/kolibri-login-works-but-content-access-causes-crash/1755/7) discussing it and showing an example of all the other settings.

I’ll try to find someone on the team who can give you more specific advice on how to tune the max memory settings on your 16 GB VM.

---

<div class="post-metadata">

**Author:** ![jonathan](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/jonathan/32/314_2.png) [@jonathan](https://community.learningequality.org/u/jonathan)\
**Post date:** [September 24, 2020, 5:47pm UTC](https://community.learningequality.org/t/clarification-of-proper-redis-config-settings/1757/3 "2020-09-24T17:47:40Z")

</div>

@mrdavidhaag Could you try these settings in Kolibri’s `.kolibri/options.ini` file in the `[Cache]` section?

It sets the max memory to about 512 MB which should be adequate for your VM. The console will log another warning if that setting isn’t enough, though.

```auto
[Cache]
CACHE_REDIS_MAXMEMORY=536870912
CACHE_REDIS_MAXMEMORY_POLICY=allkeys-lru
CACHE_BACKEND=redis

```

---

<div class="post-metadata">

**Author:** ![mrdavidhaag](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/mrdavidhaag/32/2048_2.png) [@mrdavidhaag](https://community.learningequality.org/u/mrdavidhaag)\
**Post date:** [September 24, 2020, 6:38pm UTC](https://community.learningequality.org/t/clarification-of-proper-redis-config-settings/1757/4 "2020-09-24T18:38:35Z")

</div>

Hello @jonathan  
Thank you for the quick response and good directions. I have followed your instructions and used these settings in .kolibri/options.ini [Cache] section

[Cache]  
CACHE\_BACKEND = redis  
CACHE\_REDIS\_MAXMEMORY = 536870912  
CACHE\_REDIS\_MAXMEMORY\_POLICY = allkeys-lru

I followed the syntax of space before and after equals sign to match the syntax in examples inside of options.ini file

Systemctl status kolibri now shows no more warnings about redis

● kolibri.service - LSB: kolibri daemon, an offline education platform  
Loaded: loaded (/etc/init.d/kolibri; enabled; vendor preset: enabled)  
Active: active (running) since Thu 2020-09-24 18:24:13 UTC; 37s ago  
Process: 894 ExecStart=/etc/init.d/kolibri start (code=exited, status=0/SUCCESS)  
Tasks: 9 (limit: 19113)  
Memory: 173.6M  
CGroup: /system.slice/kolibri.service  
└─971 /usr/bin/python3 /bin/kolibri start

Sep 24 18:24:13 kol-serv kolibri[941]: /usr/lib/python3/dist-packages/kolibri/dist/rest\_framework/utils/serializer\_helpers.py:107: SyntaxWarning: “is” with a literal. Did you mean “==”?  
Sep 24 18:24:13 kol-serv kolibri[941]: if value is None or value is ‘’:  
Sep 24 18:24:13 kol-serv kolibri[941]: INFO Running Kolibri with the following settings: kolibri.deployment.default.settings.base  
Sep 24 18:24:13 kol-serv kolibri[941]: INFO Configuring Redis: maxmemory-policy allkeys-lru  
Sep 24 18:24:13 kol-serv kolibri[941]: INFO Configuring Redis: maxmemory 536870912  
Sep 24 18:24:13 kol-serv kolibri[941]: INFO Running Kolibri as background process  
Sep 24 18:24:13 kol-serv kolibri[941]: INFO Starting Kolibri background workers  
Sep 24 18:24:13 kol-serv kolibri[941]: INFO Going to background mode, logging to /home/kolibri/.kolibri/logs/kolibri.txt  
Sep 24 18:24:13 kol-serv runuser[928]: pam\_unix(runuser:session): session closed for user kolibri  
Sep 24 18:24:13 kol-serv systemd[1]: Started LSB: kolibri daemon, an offline education platform.

Thank you for your help and direction.
