Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy