Skip to content

[PERF] fix performance hit - #511

Merged
gurneyalex merged 1 commit into
19.0from
19.0-fix-performance
Feb 16, 2026
Merged

gurneyalex merged 1 commit into
19.0from
19.0-fix-performance

Conversation

@gurneyalex

Copy link
Copy Markdown
Member

On the cloud platform of Camptocamp, a shared redis is used to store the sessions of the different projects -> the number of keys is huge, and using an iterative match kills the performance because of the networking overhead.

We switch to using redis.key(pattern), and since the pattern typically has a leading string which will allow redis to find the correct bucket, the performance should be good.

On the cloud platform of Camptocamp, a shared redis is used to store the
sessions of the different projects -> the number of keys is huge, and
using an iterative match kills the performance because of the networking
overhead.

We switch to using redis.key(pattern), and since the pattern typically
has a leading string which will allow redis to find the correct bucket,
the performance should be good.
@gurneyalex
gurneyalex requested a review from jcoux February 16, 2026 10:48
@gurneyalex
gurneyalex merged commit 9d25a5d into 19.0 Feb 16, 2026
4 checks passed
Comment thread session_redis/session.py
)
except StopIteration:
# No matches found
key = f"session::{self.prefix}:{partial_sid}*"

@guewen guewen Sep 7, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gurneyalex , wondering why it is not f"{self.prefix}{partial_sid}*, as session: is already in self.prefix. Also the key generation has a quirk to pay attention to: when there is no ODOO_SESSION_REDIS_PREFIX, the key is generated as session:0424149fe72a3e5ae5bd4e3789e80401230ce219 (so no ::) and when there is one it looks like: session::foo:0424149fe72a3e5ae5bd4e3789e80401230ce219.

I'm doing a backport for 18.0 (#530) and I found that I had to change that, but that's maybe related to 19.0? About the backport, it's still in draft because I will test it live before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants