Redis Session Store
Stores the session in Redis in spite of the file system in werkzeug to increase the performance of cache.
It will help to store and manage the session more easier and faster as the sessions are manage in main memory only
About Redis
Redis is an in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
Why Redis ??
It will help to store and manage the session more easier and faster as the sessions are managed in main memory only.
Exceptionally Fast : Redis is very fast and can perform about 110000 SETs per second, about 81000 GETs per second. You can use the redis-benchmark utility for doing the same on your machine.
Supports Rich data types : Redis natively supports most of the datatypes that most developers already know like list, set, sorted set, hashes. This makes it very easy to solve a variety of problems because we know which problem can be handled better by which data type.
Operations are atomic : All the Redis operations are atomic, which ensures that if two clients concurrently access Redis server will get the updated value.
Completely configure your Redis extension
1. Firstly install the redis
Steps to install redis in debian or ubuntu based server:-
- sudo apt-get update
- sudo apt install redis-server
- these commands will install redis in the server
- and by default the connection host will be (localhost/127.0.0.1)
- and port will be 6379 on which redis work
- You can run the redis by redis-cli and get all keys by KEYS *
Note: At the beginning there will be empty list of Keys
2. Then install redis library for Python by command pip3 install redis
- Then in server config file add following things:-
- server_wide_modules=web,base,wk_redis_session
- it will install wk_redis_session first
- redis_session=True
It will let the odoo session store in redis if we type redis_session to be True else it will let werkzeug to store the session in .local file session
- Configurations of redis session:-
- redis_host = host ip of redis by default it will store localhost
- redis_port = port number of redis by default it will store 6379
- redis_expire = expiry of the session in seconds by default session will expires in 5 days (432000 Seconds)
- if your redis server have ssl mode then you will have to pass the path of ssl certificate file
- For Example:-
redis_ssl_ca_certs = path of ssl certs(if having) bydefult it is None
Highlighted Features
- Below is the highlighted features of Redis Session Store
- Store and manage the session efficiently
- Supports Rich Data Types
- Works on Atomic Operations
- Exceptionally Fast
Detailed Features List
Configure the Redis Session with your Odoo Server easily
- Odoo Redis Session module provides the necessary structure to help you configure Redis with your Odoo server.
- The module allows you to save the Odoo sessions on In-memory Redis Store on the same server or a third party service.
Access the data much faster than usual.
- Since the cache is stored on Main memory instead of disk storage, accessing this data becomes much faster.
- All the Redis operations are atomic to get the updated value every time.