Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Symfony\Lock\Store\RedisStore does not use LOAD SCRIPT and EVALSHA #58452

Closed
@petrisorciprian-vitals

Description

@petrisorciprian-vitals

Description

The existing RedisStore implementation does not benefit from caching of the LUA scripts being sent to Redis.

This means that on each call to delete/save/release etc a lock in Redis, the same script is being sent over the network.

In our set-up, after modifying the implementation to benefit from LOAD SCRIPT and EVALSHA instead of plain EVAL, we saw a network bytes in drop in half (from ~140 MB to ~ 80 MB).
image

Also an increase of operations throughput in Redis was observed due to less network congestion/waiting for the script to be transferred each time before the Redis operation can be executed.

I noticed that this was already mentioned in #40883 and dropped due to it no being worth the extra complexity.

Based on my observations, this is wasteful in terms of network i/o and somewhat bottlenecking performance when employing locks, especially when using both read locks and write locks (acquireRead and acquire functions of Symfony\Component\Lock\Lock.php)

I can submit a PR which makes use of LOAD SCRIPT and EVALSHA instead.

@nicolas-grekas please reconsider merging this feature!

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions