PHPackages                             b13/distributed-locks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. b13/distributed-locks

ActiveTypo3-cms-extension[Caching](/categories/caching)

b13/distributed-locks
=====================

Adds a Redis Locking Strategy for TYPO3 frontend page generation, useful on distributed systems with NFS.

v2.0.0(1y ago)13248.2k—8.3%9[3 issues](https://github.com/b13/distributed-locks/issues)[1 PRs](https://github.com/b13/distributed-locks/pulls)GPL-2.0-or-laterPHPPHP ^8.0

Since Jun 25Pushed 1y ago2 watchersCompare

[ Source](https://github.com/b13/distributed-locks)[ Packagist](https://packagist.org/packages/b13/distributed-locks)[ RSS](/packages/b13-distributed-locks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (7)Used By (0)

Distributed Redis Locker for TYPO3 Locking Mechanism
====================================================

[](#distributed-redis-locker-for-typo3-locking-mechanism)

TYPO3 has three built-in Locking Strategies, that are chosen at runtime which fits best for the current system setup.

- SemaphoreLockStrategy
- SimpleLockStrategy
- FileLockStrategy

However, when dealing with a multi-tier system and a shared file system with multiple frontend nodes with a NFS filesystem, it is especially helpful to use a better suitable format. Redis is our weapon of choice for handling multi-node scenarios, and works just fine with TYPO3 and Caching.

This extension provides a Redis Locking mechanism to store the locks in a (shared) Redis database.

Requirements
------------

[](#requirements)

This extension is available for TYPO3 v8+ LTS, and requires the PHP package `php-redis` as well as a Redis server.

Installation
------------

[](#installation)

Install this extension via composer `composer require b13/distributed-locks` or extensions.typo3.org / Extension Manager, and activate it in the Extension Manager.

Now add the following lines to your LocalConfiguration / AdditionalConfiguration to activate Redis Locking.

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['redis'] = [
    'hostname' => '127.0.0.1',
    'database' => 12
];

```

Other options:

```
'ttl' (numeric, default is 30sec)
'port' (numeric, default is 6379)
'password' (contains the password, necessary for secure authentication if required by redis)
'priority' (numeric, default is 95) - Set priority for this locking strategy. See LockingApi documentation.

```

Disabling it in certain contextes
---------------------------------

[](#disabling-it-in-certain-contextes)

If you have different `TYPO3_CONTEXT` or environments and you want to switch off the complete redis strategy (i.e. in your staging machine), you can set this in your LocalConfiguration / AdditionalConfiguration:

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['redis']['disabled'] = true;

```

Future Development
------------------

[](#future-development)

Should be switched to `symfony/lock` to allow distributed redis services and other lockers.

Credits &amp; Background
------------------------

[](#credits--background)

Inspiration was taken from the now unmaintained extension "redis\_lock\_strategy" which we used several times, however with some drawbacks:

- No stable version for TYPO3 v9 in composer mode
- No maintainer available for releases anymore
- Destroying an object did not remove locks, ending in certain dead lock scenarios in broken scripts

Thanks to Alexander Miehe for the initial extension and the conceptual work.

Sharing our expertise
---------------------

[](#sharing-our-expertise)

[Find more TYPO3 extensions we have developed](https://b13.com/useful-typo3-extensions-from-b13-to-you) that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~364 days

Recently: every ~345 days

Total

6

Last Release

697d ago

Major Versions

v1.4.0 → v2.0.02024-06-20

PHP version history (3 changes)v1.0.0PHP ^7.0

v1.3.0PHP ^7.0 | ^8.0

v2.0.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/165630?v=4)[Benni Mack](/maintainers/bmack)[@bmack](https://github.com/bmack)

![](https://avatars.githubusercontent.com/u/2851821?v=4)[b13 GmbH](/maintainers/b13)[@b13](https://github.com/b13)

---

Top Contributors

[![bmack](https://avatars.githubusercontent.com/u/165630?v=4)](https://github.com/bmack "bmack (8 commits)")[![davidsteeb](https://avatars.githubusercontent.com/u/3862523?v=4)](https://github.com/davidsteeb "davidsteeb (4 commits)")[![sgrossberndt](https://avatars.githubusercontent.com/u/3786510?v=4)](https://github.com/sgrossberndt "sgrossberndt (2 commits)")[![sypets](https://avatars.githubusercontent.com/u/13206455?v=4)](https://github.com/sypets "sypets (2 commits)")[![achimfritz](https://avatars.githubusercontent.com/u/2152991?v=4)](https://github.com/achimfritz "achimfritz (1 commits)")[![stucki](https://avatars.githubusercontent.com/u/320916?v=4)](https://github.com/stucki "stucki (1 commits)")[![calien666](https://avatars.githubusercontent.com/u/11405116?v=4)](https://github.com/calien666 "calien666 (1 commits)")[![ArbitraryCritter](https://avatars.githubusercontent.com/u/17120528?v=4)](https://github.com/ArbitraryCritter "ArbitraryCritter (1 commits)")[![b13-michaelsemle](https://avatars.githubusercontent.com/u/23473071?v=4)](https://github.com/b13-michaelsemle "b13-michaelsemle (1 commits)")[![baschny](https://avatars.githubusercontent.com/u/337581?v=4)](https://github.com/baschny "baschny (1 commits)")

---

Tags

redislockingTYPO3 CMSnfs

### Embed Badge

![Health badge](/badges/b13-distributed-locks/health.svg)

```
[![Health](https://phpackages.com/badges/b13-distributed-locks/health.svg)](https://phpackages.com/packages/b13-distributed-locks)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[lochmueller/staticfilecache

Transparent static file cache solution using mod\_rewrite and mod\_expires. Increase performance for static pages by a factor of 230!!

1311.3M3](/packages/lochmueller-staticfilecache)[clue/redis-protocol

A streaming Redis protocol (RESP) parser and serializer written in pure PHP.

5211.0M13](/packages/clue-redis-protocol)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23517.0k1](/packages/rtcamp-nginx-helper)[avtonom/semaphore-bundle

A generic locking Symfony bundle for PHP, that uses named locks for semaphore acquire and release, to guarantee atomicity

122.8k](/packages/avtonom-semaphore-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
