OVERVIEW
This module provides a robust and high-performance solution for managing Odoo user sessions using Redis instead of the default filesystem.
By leveraging Redis as an in-memory data store, the module significantly improves session handling speed, reliability, and scalability, making it ideal for production environments, high-traffic systems, and multi-server or load-balanced Odoo deployments.
Key Features
- Store Odoo sessions securely in Redis
- Faster session read/write operations compared to filesystem storage
- Compatible with multi-worker and multi-server Odoo setups
- Prevents session loss during server restarts or worker recycling
- Centralized session storage for distributed environments
- Fully configurable Redis connection and TTL values
TTL (Time To Live) Support:
-
The module supports TTL (Time To Live) for Redis sessions, which defines how long a session remains valid in Redis before it expires automatically.
How TTL works:
- Each session key stored in Redis is assigned a TTL value (in seconds)
- The TTL is renewed automatically on user activity
- If a session remains inactive and reaches its TTL limit, Redis automatically deletes it
-
This ensures:
- Automatic cleanup of expired sessions
- Reduced memory usage in Redis
- Improved security by preventing stale or abandoned sessions
-
Benefits of TTL:
- No need for manual session cleanup jobs
- Better control over session lifetime
- Aligns Redis session expiration with Odooâs session policy
- Ideal for long-running systems with many concurrent users
Usage & Configuration:
-
After installing the module, configure the Redis session backend by adding the following parameters to your Odoo configuration file (odoo.conf)
- redis_session_db = 0
- redis_session_host = redis
- redis_session_port = 6379
- redis_session_ttl = 86400
-
Parameter Description
-
redis_session_dbRedis database index used to store Odoo sessions. ( Default is 0 )
-
redis_session_hostHostname or IP address of the Redis server.
-
redis_session_portRedis server port (default: 6379)
-
redis_session_ttlSession Time To Live (TTL) in seconds. Defines how long an inactive session remains valid before Redis expires it automatically. The TTL is renewed on user activity. (default is 24 hours)
-
-
After saving the configuration, restart the Odoo server to apply the changes.Once enabled, all user sessions will be stored and managed in Redis automatically.
SUPPORT
Please log in to comment on this module